Compare commits
234 Commits
v2022.04-r
...
v2018.11-s
| Author | SHA1 | Date | |
|---|---|---|---|
| fd915f073f | |||
| 8028962d9f | |||
| 2e43485f80 | |||
| cbe462a123 | |||
| ed513fa816 | |||
| 022dea8d36 | |||
| 67d6c24552 | |||
| f21da5ab66 | |||
| 11e5838cdb | |||
| e87bd559a3 | |||
| b9cfde9109 | |||
| 275062832c | |||
| 1b0ac8992d | |||
| 68b5cfba08 | |||
| 3de9b926c4 | |||
| b7db3619f8 | |||
| 37045967c3 | |||
| a0162f45e2 | |||
| 658e38f1a7 | |||
| 71d5ed8066 | |||
| 88dfe17619 | |||
| 4d084310ca | |||
| bdbf4d7506 | |||
| b3a725aba6 | |||
| ec157da292 | |||
| 02d5c1dfa6 | |||
| 5cd4de52ec | |||
| 1c51ffe4b1 | |||
| c25ecf1718 | |||
| ff234a202c | |||
| a99ea99ade | |||
| 0803eb6f0a | |||
| 4299e2f9d6 | |||
| 6cf129b9b9 | |||
| 16b00d6151 | |||
| 0521742dac | |||
| 6b2a20d5e9 | |||
| 22eea618b3 | |||
| d62f14dece | |||
| 89cd4a7513 | |||
| 91d9cea7d2 | |||
| 57eeb4d8cc | |||
| 2ac7bedb81 | |||
| 026ca8e670 | |||
| 0470194891 | |||
| b09e8d7430 | |||
| b17bf20445 | |||
| 368f7883c6 | |||
| 08961a8ba0 | |||
| d57907dcd9 | |||
| b329a6493b | |||
| be067d4370 | |||
| 8cdd05a678 | |||
| c3fc0de32b | |||
| 449958f998 | |||
| a442d542f9 | |||
| c77afe905d | |||
| 173c86b980 | |||
| a717a8c963 | |||
| 95be59a62b | |||
| 61082e30c2 | |||
| 42ffa538db | |||
| a9e7ff977e | |||
| 6dccaf25ab | |||
| e3da87025c | |||
| b01e1d633a | |||
| 34e08a48c5 | |||
| 5abed36ebd | |||
| d4e92b29a4 | |||
| 2294b26f4a | |||
| 2b1399e98c | |||
| 996b3080a6 | |||
| 3e098b9cba | |||
| cf4c209e78 | |||
| 86305e1d60 | |||
| 59db4e04f3 | |||
| e18553fc1a | |||
| 790af47bca | |||
| 422680882f | |||
| 497f679861 | |||
| 274fb39006 | |||
| 2a350181f0 | |||
| 79650e2b79 | |||
| 1d928b90e3 | |||
| bbd9fa6e3f | |||
| 04ba3e7d9b | |||
| b4b56a70f9 | |||
| 7cde650ff7 | |||
| 2c9ef7bba9 | |||
| 6977610cd4 | |||
| 4aeb115193 | |||
| edf333448f | |||
| 649aba2bad | |||
| 78bcf76da2 | |||
| d42837075d | |||
| d08a553a8e | |||
| e11d95c3ce | |||
| 97c4504a0e | |||
| 639d358acf | |||
| f2e7a5b262 | |||
| 9cfd3376f7 | |||
| ccc895942f | |||
| c3217b04cd | |||
| 4701adfa82 | |||
| 51da0de92c | |||
| 539d60142f | |||
| 038753164d | |||
| 7dc89bab59 | |||
| 891268d775 | |||
| 9ee3938bca | |||
| e0fcd22cd6 | |||
| bcad06b2ff | |||
| 7157fa1d0e | |||
| 92b1335d5f | |||
| bf89e5e463 | |||
| f4bc35b197 | |||
| 66793a538d | |||
| 3d48f24256 | |||
| 208786420d | |||
| fe4a37e985 | |||
| a62067f8ff | |||
| 924fb0070d | |||
| 0c82ca32d8 | |||
| a2ddf2bacf | |||
| df7e29293b | |||
| ea6fec0b6f | |||
| 966e7ed9af | |||
| 36cec76b09 | |||
| 68be2f8e4f | |||
| 30db435de3 | |||
| bc858f6314 | |||
| 459a0c45b8 | |||
| a4ec9ce9df | |||
| a897ef513f | |||
| bfa3dd2269 | |||
| 0794bcc845 | |||
| 0f1eb28985 | |||
| 04b05a110a | |||
| 2a2abc60b2 | |||
| a94c0486c1 | |||
| 0ea9de32aa | |||
| de03197119 | |||
| 3a4bf1551c | |||
| 2a1aa43aef | |||
| de99afc2b0 | |||
| a1423d5ddc | |||
| c766a755dd | |||
| c89d129408 | |||
| 61a2ad5773 | |||
| ba6fcdb933 | |||
| 6bdb3885bf | |||
| 790b4cd7dc | |||
| 81d312946c | |||
| 624506fea3 | |||
| 3efd0a5da1 | |||
| c8521622a3 | |||
| 35bbb3e561 | |||
| 702c220c6a | |||
| 466fa08754 | |||
| 1a9a49c696 | |||
| d412c90472 | |||
| 3b8056ccbc | |||
| 3eee756d7a | |||
| 2545f10899 | |||
| 3b5b7158a7 | |||
| e7d2582fac | |||
| 48b24d6363 | |||
| a093c9007d | |||
| 6403ca7be6 | |||
| 6f250948c2 | |||
| 36a7d40ef9 | |||
| 4c1f94966f | |||
| 13da149192 | |||
| fbc47b135b | |||
| aebd74760b | |||
| 8c5d675f52 | |||
| 21c5829424 | |||
| 940ddbc900 | |||
| b377093fca | |||
| 5788a42f1a | |||
| 16d6123875 | |||
| 1c0f4f647a | |||
| 10f73393dc | |||
| 03dd632d3d | |||
| 953db29a1e | |||
| 60d5ed2593 | |||
| c488932624 | |||
| 4e5a7e85a4 | |||
| 5f708b807b | |||
| 0f02fac220 | |||
| 4efe255ddd | |||
| cb5e4e89b3 | |||
| 54fe4129a6 | |||
| 5fe1f7750b | |||
| f7503df12a | |||
| e8cc04677d | |||
| 4d63375083 | |||
| a9501c3eb8 | |||
| 57588fa01f | |||
| 9b08cfac37 | |||
| 7414eea7e0 | |||
| be710c5302 | |||
| 6b6506fcca | |||
| f55001ad5e | |||
| aacb637b69 | |||
| dafa5e1643 | |||
| e3614a1c5c | |||
| 41b168d1ca | |||
| 161ca183f1 | |||
| 62e1fc0969 | |||
| 3cbc4657ac | |||
| f9171debe0 | |||
| afbdd009be | |||
| e3a6e5a5e6 | |||
| 6b420c01c2 | |||
| 72b346ed24 | |||
| b417219136 | |||
| 76eea16eb0 | |||
| 146431276c | |||
| 3de73fb9d1 | |||
| aaef786348 | |||
| b6d9a0f0ca | |||
| a120b9bdb3 | |||
| 00a5933e98 | |||
| 3b9e8d9000 | |||
| 62f620eb8d | |||
| 85e7457155 | |||
| ffe232a956 | |||
| 6893b88a4a | |||
| 5b2ef8968d | |||
| 3c2227a329 | |||
| 908c3bf50f | |||
| e1532f83da | |||
| a012f551a8 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -88,3 +88,6 @@ GTAGS
|
||||
*.orig
|
||||
*~
|
||||
\#*#
|
||||
|
||||
/oe-*
|
||||
bitbake-cookerdaemon.log
|
||||
|
||||
@ -242,7 +242,9 @@ F: drivers/misc/stm32mp_fuse.c
|
||||
F: drivers/mmc/stm32_sdmmc2.c
|
||||
F: drivers/phy/phy-stm32-usbphyc.c
|
||||
F: drivers/pinctrl/pinctrl_stm32.c
|
||||
F: drivers/power/pmic/stpmic1.c
|
||||
F: drivers/power/regulator/stm32-vrefbuf.c
|
||||
F: drivers/power/regulator/stpmic1.c
|
||||
F: drivers/ram/stm32mp1/
|
||||
F: drivers/misc/stm32_rcc.c
|
||||
F: drivers/reset/stm32-reset.c
|
||||
|
||||
2
Makefile
2
Makefile
@ -3,7 +3,7 @@
|
||||
VERSION = 2018
|
||||
PATCHLEVEL = 11
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -stm32mp-r4
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
3
README
3
README
@ -2192,6 +2192,9 @@ The following options need to be configured:
|
||||
CONFIG_SF_DEFAULT_MODE (see include/spi.h)
|
||||
CONFIG_SF_DEFAULT_SPEED in Hz
|
||||
|
||||
In case of DT boot, SPI don't read default speed and mode
|
||||
from CONFIG_*, but from platdata values computed from available
|
||||
DT node
|
||||
|
||||
- TFTP Fixed UDP Port:
|
||||
CONFIG_TFTP_PORT
|
||||
|
||||
@ -1313,21 +1313,27 @@ config ARCH_STM32MP
|
||||
select DM_GPIO
|
||||
select DM_RESET
|
||||
select DM_SERIAL
|
||||
select ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||
select MISC
|
||||
select OF_CONTROL
|
||||
select OF_LIBFDT
|
||||
imply OF_LIBFDT_OVERLAY
|
||||
select OF_SYSTEM_SETUP
|
||||
select PINCTRL
|
||||
select REGMAP
|
||||
select SUPPORT_SPL
|
||||
select SYSCON
|
||||
select SYSRESET
|
||||
select SYS_ARCH_TIMER
|
||||
select SYS_THUMB_BUILD
|
||||
imply CMD_DM
|
||||
imply CMD_POWEROFF
|
||||
help
|
||||
Support for STM32MP SoC family developed by STMicroelectronics,
|
||||
MPUs based on ARM cortex A core
|
||||
U-BOOT is running in DDR and SPL support is the unsecure First Stage
|
||||
BootLoader (FSBL)
|
||||
U-BOOT is running in DDR, loaded by the First Stage BootLoader (FSBL).
|
||||
FBSL can be TF-A: Trusted Firmware for Cortex A, for trusted boot chain.
|
||||
SPL is the unsecure FSBL for the basic boot chain.
|
||||
|
||||
config ARCH_ROCKCHIP
|
||||
bool "Support Rockchip SoCs"
|
||||
|
||||
@ -49,6 +49,9 @@ unsigned long long get_ticks(void)
|
||||
|
||||
ulong timer_get_boot_us(void)
|
||||
{
|
||||
if (!gd->arch.timer_rate_hz)
|
||||
timer_init();
|
||||
|
||||
return lldiv(get_ticks(), gd->arch.timer_rate_hz / 1000000);
|
||||
}
|
||||
|
||||
|
||||
@ -553,6 +553,8 @@ dtb-$(CONFIG_ARCH_ASPEED) += ast2500-evb.dtb
|
||||
dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
|
||||
|
||||
dtb-$(CONFIG_TARGET_STM32MP1) += \
|
||||
stm32mp157a-dk1.dtb \
|
||||
stm32mp157c-dk2.dtb \
|
||||
stm32mp157c-ed1.dtb \
|
||||
stm32mp157c-ev1.dtb
|
||||
|
||||
|
||||
@ -92,57 +92,46 @@
|
||||
};
|
||||
|
||||
&gpioa {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiob {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioc {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioe {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioh {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioi {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioj {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiok {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
|
||||
@ -87,57 +87,46 @@
|
||||
};
|
||||
|
||||
&gpioa {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiob {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioc {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioe {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioh {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioi {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioj {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiok {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
|
||||
@ -92,57 +92,46 @@
|
||||
};
|
||||
|
||||
&gpioa {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiob {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioc {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioe {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioh {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioi {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioj {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiok {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
|
||||
@ -130,7 +130,6 @@
|
||||
gpioa: gpio@40020000 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x0 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOA)>;
|
||||
st,bank-name = "GPIOA";
|
||||
@ -140,7 +139,6 @@
|
||||
gpiob: gpio@40020400 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x400 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOB)>;
|
||||
st,bank-name = "GPIOB";
|
||||
@ -151,7 +149,6 @@
|
||||
gpioc: gpio@40020800 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x800 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOC)>;
|
||||
st,bank-name = "GPIOC";
|
||||
@ -161,7 +158,6 @@
|
||||
gpiod: gpio@40020c00 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0xc00 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOD)>;
|
||||
st,bank-name = "GPIOD";
|
||||
@ -171,7 +167,6 @@
|
||||
gpioe: gpio@40021000 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1000 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOE)>;
|
||||
st,bank-name = "GPIOE";
|
||||
@ -181,7 +176,6 @@
|
||||
gpiof: gpio@40021400 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1400 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOF)>;
|
||||
st,bank-name = "GPIOF";
|
||||
@ -191,7 +185,6 @@
|
||||
gpiog: gpio@40021800 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1800 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOG)>;
|
||||
st,bank-name = "GPIOG";
|
||||
@ -201,7 +194,6 @@
|
||||
gpioh: gpio@40021c00 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1c00 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOH)>;
|
||||
st,bank-name = "GPIOH";
|
||||
@ -211,7 +203,6 @@
|
||||
gpioi: gpio@40022000 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x2000 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOI)>;
|
||||
st,bank-name = "GPIOI";
|
||||
@ -221,7 +212,6 @@
|
||||
gpioj: gpio@40022400 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x2400 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOJ)>;
|
||||
st,bank-name = "GPIOJ";
|
||||
@ -231,7 +221,6 @@
|
||||
gpiok: gpio@40022800 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x2800 0x400>;
|
||||
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(GPIOK)>;
|
||||
st,bank-name = "GPIOK";
|
||||
|
||||
@ -54,7 +54,6 @@
|
||||
gpioa: gpio@58020000 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x0 0x400>;
|
||||
clocks = <&rcc GPIOA_CK>;
|
||||
st,bank-name = "GPIOA";
|
||||
@ -63,7 +62,6 @@
|
||||
gpiob: gpio@58020400 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x400 0x400>;
|
||||
clocks = <&rcc GPIOB_CK>;
|
||||
st,bank-name = "GPIOB";
|
||||
@ -72,7 +70,6 @@
|
||||
gpioc: gpio@58020800 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x800 0x400>;
|
||||
clocks = <&rcc GPIOC_CK>;
|
||||
st,bank-name = "GPIOC";
|
||||
@ -81,7 +78,6 @@
|
||||
gpiod: gpio@58020c00 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0xc00 0x400>;
|
||||
clocks = <&rcc GPIOD_CK>;
|
||||
st,bank-name = "GPIOD";
|
||||
@ -90,7 +86,6 @@
|
||||
gpioe: gpio@58021000 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1000 0x400>;
|
||||
clocks = <&rcc GPIOE_CK>;
|
||||
st,bank-name = "GPIOE";
|
||||
@ -99,7 +94,6 @@
|
||||
gpiof: gpio@58021400 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1400 0x400>;
|
||||
clocks = <&rcc GPIOF_CK>;
|
||||
st,bank-name = "GPIOF";
|
||||
@ -108,7 +102,6 @@
|
||||
gpiog: gpio@58021800 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1800 0x400>;
|
||||
clocks = <&rcc GPIOG_CK>;
|
||||
st,bank-name = "GPIOG";
|
||||
@ -117,7 +110,6 @@
|
||||
gpioh: gpio@58021c00 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x1c00 0x400>;
|
||||
clocks = <&rcc GPIOH_CK>;
|
||||
st,bank-name = "GPIOH";
|
||||
@ -126,7 +118,6 @@
|
||||
gpioi: gpio@58022000 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x2000 0x400>;
|
||||
clocks = <&rcc GPIOI_CK>;
|
||||
st,bank-name = "GPIOI";
|
||||
@ -135,7 +126,6 @@
|
||||
gpioj: gpio@58022400 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x2400 0x400>;
|
||||
clocks = <&rcc GPIOJ_CK>;
|
||||
st,bank-name = "GPIOJ";
|
||||
@ -144,7 +134,6 @@
|
||||
gpiok: gpio@58022800 {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
compatible = "st,stm32-gpio";
|
||||
reg = <0x2800 0x400>;
|
||||
clocks = <&rcc GPIOK_CK>;
|
||||
st,bank-name = "GPIOK";
|
||||
|
||||
@ -105,5 +105,5 @@
|
||||
<&pinctrl_sdmmc1_level_shifter>;
|
||||
pinctrl-names = "default";
|
||||
bus-width = <4>;
|
||||
st,dirpol;
|
||||
st,sig-dir;
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
/ {
|
||||
soc {
|
||||
ddr: ddr@0x5A003000{
|
||||
ddr: ddr@5A003000{
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
compatible = "st,stm32mp1-ddr";
|
||||
|
||||
120
arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binF.dtsi
Normal file
120
arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binF.dtsi
Normal file
@ -0,0 +1,120 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* STM32MP157C DK1/DK2 BOARD configuration
|
||||
* 1x DDR3L 4Gb, 16-bit, 533MHz.
|
||||
* Reference used NT5CC256M16DP-DI from NANYA
|
||||
*
|
||||
* DDR type / Platform DDR3/3L
|
||||
* freq 533MHz
|
||||
* width 16
|
||||
* datasheet 1 = MT41J256M16-187 / DDR3-1066 bin F
|
||||
* DDR density 4
|
||||
* timing mode optimized
|
||||
* Scheduling/QoS options : type = 2
|
||||
* address mapping : RBC
|
||||
* Tc > + 85C : N
|
||||
*/
|
||||
#define DDR_MEM_NAME "DDR3-1066/777 bin F 1x4Gb 533MHz v1.45"
|
||||
#define DDR_MEM_SPEED 533000
|
||||
#define DDR_MEM_SIZE 0x20000000
|
||||
|
||||
#define DDR_MSTR 0x00041401
|
||||
#define DDR_MRCTRL0 0x00000010
|
||||
#define DDR_MRCTRL1 0x00000000
|
||||
#define DDR_DERATEEN 0x00000000
|
||||
#define DDR_DERATEINT 0x00800000
|
||||
#define DDR_PWRCTL 0x00000000
|
||||
#define DDR_PWRTMG 0x00400010
|
||||
#define DDR_HWLPCTL 0x00000000
|
||||
#define DDR_RFSHCTL0 0x00210000
|
||||
#define DDR_RFSHCTL3 0x00000000
|
||||
#define DDR_RFSHTMG 0x0081008B
|
||||
#define DDR_CRCPARCTL0 0x00000000
|
||||
#define DDR_DRAMTMG0 0x121B2414
|
||||
#define DDR_DRAMTMG1 0x000A041B
|
||||
#define DDR_DRAMTMG2 0x0607080F
|
||||
#define DDR_DRAMTMG3 0x0050400C
|
||||
#define DDR_DRAMTMG4 0x07040607
|
||||
#define DDR_DRAMTMG5 0x06060403
|
||||
#define DDR_DRAMTMG6 0x02020002
|
||||
#define DDR_DRAMTMG7 0x00000202
|
||||
#define DDR_DRAMTMG8 0x00001005
|
||||
#define DDR_DRAMTMG14 0x000000A0
|
||||
#define DDR_ZQCTL0 0xC2000040
|
||||
#define DDR_DFITMG0 0x02050105
|
||||
#define DDR_DFITMG1 0x00000202
|
||||
#define DDR_DFILPCFG0 0x07000000
|
||||
#define DDR_DFIUPD0 0xC0400003
|
||||
#define DDR_DFIUPD1 0x00000000
|
||||
#define DDR_DFIUPD2 0x00000000
|
||||
#define DDR_DFIPHYMSTR 0x00000000
|
||||
#define DDR_ADDRMAP1 0x00070707
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x1F000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x06060606
|
||||
#define DDR_ADDRMAP6 0x0F060606
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_ODTCFG 0x06000600
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00000C01
|
||||
#define DDR_SCHED1 0x00000000
|
||||
#define DDR_PERFHPR1 0x01000001
|
||||
#define DDR_PERFLPR1 0x08000200
|
||||
#define DDR_PERFWR1 0x08000400
|
||||
#define DDR_DBG0 0x00000000
|
||||
#define DDR_DBG1 0x00000000
|
||||
#define DDR_DBGCMD 0x00000000
|
||||
#define DDR_POISONCFG 0x00000000
|
||||
#define DDR_PCCFG 0x00000010
|
||||
#define DDR_PCFGR_0 0x00010000
|
||||
#define DDR_PCFGW_0 0x00000000
|
||||
#define DDR_PCFGQOS0_0 0x02100C03
|
||||
#define DDR_PCFGQOS1_0 0x00800100
|
||||
#define DDR_PCFGWQOS0_0 0x01100C03
|
||||
#define DDR_PCFGWQOS1_0 0x01000200
|
||||
#define DDR_PCFGR_1 0x00010000
|
||||
#define DDR_PCFGW_1 0x00000000
|
||||
#define DDR_PCFGQOS0_1 0x02100C03
|
||||
#define DDR_PCFGQOS1_1 0x00800040
|
||||
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||
#define DDR_PCFGWQOS1_1 0x01000200
|
||||
#define DDR_PGCR 0x01442E02
|
||||
#define DDR_PTR0 0x0022AA5B
|
||||
#define DDR_PTR1 0x04841104
|
||||
#define DDR_PTR2 0x042DA068
|
||||
#define DDR_ACIOCR 0x10400812
|
||||
#define DDR_DXCCR 0x00000C40
|
||||
#define DDR_DSGCR 0xF200011F
|
||||
#define DDR_DCR 0x0000000B
|
||||
#define DDR_DTPR0 0x36D477D0
|
||||
#define DDR_DTPR1 0x098B00D8
|
||||
#define DDR_DTPR2 0x10023600
|
||||
#define DDR_MR0 0x00000830
|
||||
#define DDR_MR1 0x00000000
|
||||
#define DDR_MR2 0x00000208
|
||||
#define DDR_MR3 0x00000000
|
||||
#define DDR_ODTCR 0x00010000
|
||||
#define DDR_ZQ0CR1 0x00000038
|
||||
#define DDR_DX0GCR 0x0000CE81
|
||||
#define DDR_DX0DLLCR 0x40000000
|
||||
#define DDR_DX0DQTR 0xFFFFFFFF
|
||||
#define DDR_DX0DQSTR 0x3DB02000
|
||||
#define DDR_DX1GCR 0x0000CE81
|
||||
#define DDR_DX1DLLCR 0x40000000
|
||||
#define DDR_DX1DQTR 0xFFFFFFFF
|
||||
#define DDR_DX1DQSTR 0x3DB02000
|
||||
#define DDR_DX2GCR 0x0000CE80
|
||||
#define DDR_DX2DLLCR 0x40000000
|
||||
#define DDR_DX2DQTR 0xFFFFFFFF
|
||||
#define DDR_DX2DQSTR 0x3DB02000
|
||||
#define DDR_DX3GCR 0x0000CE80
|
||||
#define DDR_DX3DLLCR 0x40000000
|
||||
#define DDR_DX3DQTR 0xFFFFFFFF
|
||||
#define DDR_DX3DQSTR 0x3DB02000
|
||||
|
||||
#include "stm32mp15-ddr.dtsi"
|
||||
120
arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi
Normal file
120
arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi
Normal file
@ -0,0 +1,120 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* STM32MP157C DK1/DK2 BOARD configuration
|
||||
* 1x DDR3L 4Gb, 16-bit, 533MHz.
|
||||
* Reference used NT5CC256M16DP-DI from NANYA
|
||||
*
|
||||
* DDR type / Platform DDR3/3L
|
||||
* freq 533MHz
|
||||
* width 16
|
||||
* datasheet 0 = MT41J256M16-187 / DDR3-1066 bin G
|
||||
* DDR density 4
|
||||
* timing mode optimized
|
||||
* Scheduling/QoS options : type = 2
|
||||
* address mapping : RBC
|
||||
* Tc > + 85C : N
|
||||
*/
|
||||
#define DDR_MEM_NAME "DDR3-1066/888 bin G 1x4Gb 533MHz v1.45"
|
||||
#define DDR_MEM_SPEED 533000
|
||||
#define DDR_MEM_SIZE 0x20000000
|
||||
|
||||
#define DDR_MSTR 0x00041401
|
||||
#define DDR_MRCTRL0 0x00000010
|
||||
#define DDR_MRCTRL1 0x00000000
|
||||
#define DDR_DERATEEN 0x00000000
|
||||
#define DDR_DERATEINT 0x00800000
|
||||
#define DDR_PWRCTL 0x00000000
|
||||
#define DDR_PWRTMG 0x00400010
|
||||
#define DDR_HWLPCTL 0x00000000
|
||||
#define DDR_RFSHCTL0 0x00210000
|
||||
#define DDR_RFSHCTL3 0x00000000
|
||||
#define DDR_RFSHTMG 0x0081008B
|
||||
#define DDR_CRCPARCTL0 0x00000000
|
||||
#define DDR_DRAMTMG0 0x121B2414
|
||||
#define DDR_DRAMTMG1 0x000A041C
|
||||
#define DDR_DRAMTMG2 0x0608090F
|
||||
#define DDR_DRAMTMG3 0x0050400C
|
||||
#define DDR_DRAMTMG4 0x08040608
|
||||
#define DDR_DRAMTMG5 0x06060403
|
||||
#define DDR_DRAMTMG6 0x02020002
|
||||
#define DDR_DRAMTMG7 0x00000202
|
||||
#define DDR_DRAMTMG8 0x00001005
|
||||
#define DDR_DRAMTMG14 0x000000A0
|
||||
#define DDR_ZQCTL0 0xC2000040
|
||||
#define DDR_DFITMG0 0x02060105
|
||||
#define DDR_DFITMG1 0x00000202
|
||||
#define DDR_DFILPCFG0 0x07000000
|
||||
#define DDR_DFIUPD0 0xC0400003
|
||||
#define DDR_DFIUPD1 0x00000000
|
||||
#define DDR_DFIUPD2 0x00000000
|
||||
#define DDR_DFIPHYMSTR 0x00000000
|
||||
#define DDR_ADDRMAP1 0x00070707
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x1F000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x06060606
|
||||
#define DDR_ADDRMAP6 0x0F060606
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_ODTCFG 0x06000600
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00000C01
|
||||
#define DDR_SCHED1 0x00000000
|
||||
#define DDR_PERFHPR1 0x01000001
|
||||
#define DDR_PERFLPR1 0x08000200
|
||||
#define DDR_PERFWR1 0x08000400
|
||||
#define DDR_DBG0 0x00000000
|
||||
#define DDR_DBG1 0x00000000
|
||||
#define DDR_DBGCMD 0x00000000
|
||||
#define DDR_POISONCFG 0x00000000
|
||||
#define DDR_PCCFG 0x00000010
|
||||
#define DDR_PCFGR_0 0x00010000
|
||||
#define DDR_PCFGW_0 0x00000000
|
||||
#define DDR_PCFGQOS0_0 0x02100C03
|
||||
#define DDR_PCFGQOS1_0 0x00800100
|
||||
#define DDR_PCFGWQOS0_0 0x01100C03
|
||||
#define DDR_PCFGWQOS1_0 0x01000200
|
||||
#define DDR_PCFGR_1 0x00010000
|
||||
#define DDR_PCFGW_1 0x00000000
|
||||
#define DDR_PCFGQOS0_1 0x02100C03
|
||||
#define DDR_PCFGQOS1_1 0x00800040
|
||||
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||
#define DDR_PCFGWQOS1_1 0x01000200
|
||||
#define DDR_PGCR 0x01442E02
|
||||
#define DDR_PTR0 0x0022AA5B
|
||||
#define DDR_PTR1 0x04841104
|
||||
#define DDR_PTR2 0x042DA068
|
||||
#define DDR_ACIOCR 0x10400812
|
||||
#define DDR_DXCCR 0x00000C40
|
||||
#define DDR_DSGCR 0xF200011F
|
||||
#define DDR_DCR 0x0000000B
|
||||
#define DDR_DTPR0 0x38D488D0
|
||||
#define DDR_DTPR1 0x098B00D8
|
||||
#define DDR_DTPR2 0x10023600
|
||||
#define DDR_MR0 0x00000840
|
||||
#define DDR_MR1 0x00000000
|
||||
#define DDR_MR2 0x00000208
|
||||
#define DDR_MR3 0x00000000
|
||||
#define DDR_ODTCR 0x00010000
|
||||
#define DDR_ZQ0CR1 0x00000038
|
||||
#define DDR_DX0GCR 0x0000CE81
|
||||
#define DDR_DX0DLLCR 0x40000000
|
||||
#define DDR_DX0DQTR 0xFFFFFFFF
|
||||
#define DDR_DX0DQSTR 0x3DB02000
|
||||
#define DDR_DX1GCR 0x0000CE81
|
||||
#define DDR_DX1DLLCR 0x40000000
|
||||
#define DDR_DX1DQTR 0xFFFFFFFF
|
||||
#define DDR_DX1DQSTR 0x3DB02000
|
||||
#define DDR_DX2GCR 0x0000CE80
|
||||
#define DDR_DX2DLLCR 0x40000000
|
||||
#define DDR_DX2DQTR 0xFFFFFFFF
|
||||
#define DDR_DX2DQSTR 0x3DB02000
|
||||
#define DDR_DX3GCR 0x0000CE80
|
||||
#define DDR_DX3DLLCR 0x40000000
|
||||
#define DDR_DX3DQTR 0xFFFFFFFF
|
||||
#define DDR_DX3DQSTR 0x3DB02000
|
||||
|
||||
#include "stm32mp15-ddr.dtsi"
|
||||
120
arch/arm/dts/stm32mp15-ddr3-2x4Gb-1066-binF.dtsi
Normal file
120
arch/arm/dts/stm32mp15-ddr3-2x4Gb-1066-binF.dtsi
Normal file
@ -0,0 +1,120 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* STM32MP157C ED1 BOARD configuration
|
||||
* 2x DDR3L 4Gb each, 16-bit, 533MHz, Single Die Package in flyby topology.
|
||||
* Reference used NT5CC256M16DP-DI from NANYA
|
||||
*
|
||||
* DDR type / Platform DDR3/3L
|
||||
* freq 533MHz
|
||||
* width 32
|
||||
* datasheet 1 = MT41J256M16-187 / DDR3-1066 bin F
|
||||
* DDR density 8
|
||||
* timing mode optimized
|
||||
* Scheduling/QoS options : type = 2
|
||||
* address mapping : RBC
|
||||
* Tc > + 85C : N
|
||||
*/
|
||||
#define DDR_MEM_NAME "DDR3-1066/777 bin F 2x4Gb 533MHz v1.45"
|
||||
#define DDR_MEM_SPEED 533000
|
||||
#define DDR_MEM_SIZE 0x40000000
|
||||
|
||||
#define DDR_MSTR 0x00040401
|
||||
#define DDR_MRCTRL0 0x00000010
|
||||
#define DDR_MRCTRL1 0x00000000
|
||||
#define DDR_DERATEEN 0x00000000
|
||||
#define DDR_DERATEINT 0x00800000
|
||||
#define DDR_PWRCTL 0x00000000
|
||||
#define DDR_PWRTMG 0x00400010
|
||||
#define DDR_HWLPCTL 0x00000000
|
||||
#define DDR_RFSHCTL0 0x00210000
|
||||
#define DDR_RFSHCTL3 0x00000000
|
||||
#define DDR_RFSHTMG 0x0081008B
|
||||
#define DDR_CRCPARCTL0 0x00000000
|
||||
#define DDR_DRAMTMG0 0x121B2414
|
||||
#define DDR_DRAMTMG1 0x000A041B
|
||||
#define DDR_DRAMTMG2 0x0607080F
|
||||
#define DDR_DRAMTMG3 0x0050400C
|
||||
#define DDR_DRAMTMG4 0x07040607
|
||||
#define DDR_DRAMTMG5 0x06060403
|
||||
#define DDR_DRAMTMG6 0x02020002
|
||||
#define DDR_DRAMTMG7 0x00000202
|
||||
#define DDR_DRAMTMG8 0x00001005
|
||||
#define DDR_DRAMTMG14 0x000000A0
|
||||
#define DDR_ZQCTL0 0xC2000040
|
||||
#define DDR_DFITMG0 0x02050105
|
||||
#define DDR_DFITMG1 0x00000202
|
||||
#define DDR_DFILPCFG0 0x07000000
|
||||
#define DDR_DFIUPD0 0xC0400003
|
||||
#define DDR_DFIUPD1 0x00000000
|
||||
#define DDR_DFIUPD2 0x00000000
|
||||
#define DDR_DFIPHYMSTR 0x00000000
|
||||
#define DDR_ADDRMAP1 0x00080808
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x00000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x07070707
|
||||
#define DDR_ADDRMAP6 0x0F070707
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_ODTCFG 0x06000600
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00000C01
|
||||
#define DDR_SCHED1 0x00000000
|
||||
#define DDR_PERFHPR1 0x01000001
|
||||
#define DDR_PERFLPR1 0x08000200
|
||||
#define DDR_PERFWR1 0x08000400
|
||||
#define DDR_DBG0 0x00000000
|
||||
#define DDR_DBG1 0x00000000
|
||||
#define DDR_DBGCMD 0x00000000
|
||||
#define DDR_POISONCFG 0x00000000
|
||||
#define DDR_PCCFG 0x00000010
|
||||
#define DDR_PCFGR_0 0x00010000
|
||||
#define DDR_PCFGW_0 0x00000000
|
||||
#define DDR_PCFGQOS0_0 0x02100C03
|
||||
#define DDR_PCFGQOS1_0 0x00800100
|
||||
#define DDR_PCFGWQOS0_0 0x01100C03
|
||||
#define DDR_PCFGWQOS1_0 0x01000200
|
||||
#define DDR_PCFGR_1 0x00010000
|
||||
#define DDR_PCFGW_1 0x00000000
|
||||
#define DDR_PCFGQOS0_1 0x02100C03
|
||||
#define DDR_PCFGQOS1_1 0x00800040
|
||||
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||
#define DDR_PCFGWQOS1_1 0x01000200
|
||||
#define DDR_PGCR 0x01442E02
|
||||
#define DDR_PTR0 0x0022AA5B
|
||||
#define DDR_PTR1 0x04841104
|
||||
#define DDR_PTR2 0x042DA068
|
||||
#define DDR_ACIOCR 0x10400812
|
||||
#define DDR_DXCCR 0x00000C40
|
||||
#define DDR_DSGCR 0xF200011F
|
||||
#define DDR_DCR 0x0000000B
|
||||
#define DDR_DTPR0 0x36D477D0
|
||||
#define DDR_DTPR1 0x098B00D8
|
||||
#define DDR_DTPR2 0x10023600
|
||||
#define DDR_MR0 0x00000830
|
||||
#define DDR_MR1 0x00000000
|
||||
#define DDR_MR2 0x00000208
|
||||
#define DDR_MR3 0x00000000
|
||||
#define DDR_ODTCR 0x00010000
|
||||
#define DDR_ZQ0CR1 0x00000038
|
||||
#define DDR_DX0GCR 0x0000CE81
|
||||
#define DDR_DX0DLLCR 0x40000000
|
||||
#define DDR_DX0DQTR 0xFFFFFFFF
|
||||
#define DDR_DX0DQSTR 0x3DB02000
|
||||
#define DDR_DX1GCR 0x0000CE81
|
||||
#define DDR_DX1DLLCR 0x40000000
|
||||
#define DDR_DX1DQTR 0xFFFFFFFF
|
||||
#define DDR_DX1DQSTR 0x3DB02000
|
||||
#define DDR_DX2GCR 0x0000CE81
|
||||
#define DDR_DX2DLLCR 0x40000000
|
||||
#define DDR_DX2DQTR 0xFFFFFFFF
|
||||
#define DDR_DX2DQSTR 0x3DB02000
|
||||
#define DDR_DX3GCR 0x0000CE81
|
||||
#define DDR_DX3DLLCR 0x40000000
|
||||
#define DDR_DX3DQTR 0xFFFFFFFF
|
||||
#define DDR_DX3DQSTR 0x3DB02000
|
||||
|
||||
#include "stm32mp15-ddr.dtsi"
|
||||
@ -1,9 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
/* STM32MP157C ED1 and ED2 BOARD configuration
|
||||
*
|
||||
* STM32MP157C ED1 BOARD configuration
|
||||
* 2x DDR3L 4Gb each, 16-bit, 533MHz, Single Die Package in flyby topology.
|
||||
* Reference used NT5CC256M16DP-DI from NANYA
|
||||
*
|
||||
@ -15,10 +14,10 @@
|
||||
* timing mode optimized
|
||||
* Scheduling/QoS options : type = 2
|
||||
* address mapping : RBC
|
||||
* Tc > + 85C : N
|
||||
*/
|
||||
|
||||
#define DDR_MEM_NAME "DDR3-1066 bin G 2x4Gb 533MHz v1.36"
|
||||
#define DDR_MEM_SPEED 533
|
||||
#define DDR_MEM_NAME "DDR3-1066/888 bin G 2x4Gb 533MHz v1.45"
|
||||
#define DDR_MEM_SPEED 533000
|
||||
#define DDR_MEM_SIZE 0x40000000
|
||||
|
||||
#define DDR_MSTR 0x00040401
|
||||
@ -62,7 +61,7 @@
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_ODTCFG 0x06000600
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00001201
|
||||
#define DDR_SCHED 0x00000C01
|
||||
#define DDR_SCHED1 0x00000000
|
||||
#define DDR_PERFHPR1 0x01000001
|
||||
#define DDR_PERFLPR1 0x08000200
|
||||
@ -74,15 +73,15 @@
|
||||
#define DDR_PCCFG 0x00000010
|
||||
#define DDR_PCFGR_0 0x00010000
|
||||
#define DDR_PCFGW_0 0x00000000
|
||||
#define DDR_PCFGQOS0_0 0x02100B03
|
||||
#define DDR_PCFGQOS0_0 0x02100C03
|
||||
#define DDR_PCFGQOS1_0 0x00800100
|
||||
#define DDR_PCFGWQOS0_0 0x01100B03
|
||||
#define DDR_PCFGWQOS0_0 0x01100C03
|
||||
#define DDR_PCFGWQOS1_0 0x01000200
|
||||
#define DDR_PCFGR_1 0x00010000
|
||||
#define DDR_PCFGW_1 0x00000000
|
||||
#define DDR_PCFGQOS0_1 0x02100B03
|
||||
#define DDR_PCFGQOS1_1 0x00800100
|
||||
#define DDR_PCFGWQOS0_1 0x01100B03
|
||||
#define DDR_PCFGQOS0_1 0x02100C03
|
||||
#define DDR_PCFGQOS1_1 0x00800040
|
||||
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||
#define DDR_PCFGWQOS1_1 0x01000200
|
||||
#define DDR_PGCR 0x01442E02
|
||||
#define DDR_PTR0 0x0022AA5B
|
||||
@ -90,7 +89,7 @@
|
||||
#define DDR_PTR2 0x042DA068
|
||||
#define DDR_ACIOCR 0x10400812
|
||||
#define DDR_DXCCR 0x00000C40
|
||||
#define DDR_DSGCR 0xF200001F
|
||||
#define DDR_DSGCR 0xF200011F
|
||||
#define DDR_DCR 0x0000000B
|
||||
#define DDR_DTPR0 0x38D488D0
|
||||
#define DDR_DTPR1 0x098B00D8
|
||||
@ -100,7 +99,7 @@
|
||||
#define DDR_MR2 0x00000208
|
||||
#define DDR_MR3 0x00000000
|
||||
#define DDR_ODTCR 0x00010000
|
||||
#define DDR_ZQ0CR1 0x0000005B
|
||||
#define DDR_ZQ0CR1 0x00000038
|
||||
#define DDR_DX0GCR 0x0000CE81
|
||||
#define DDR_DX0DLLCR 0x40000000
|
||||
#define DDR_DX0DQTR 0xFFFFFFFF
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -17,16 +17,23 @@
|
||||
gpio9 = &gpioj;
|
||||
gpio10 = &gpiok;
|
||||
gpio25 = &gpioz;
|
||||
pinctrl0 = &pinctrl;
|
||||
pinctrl1 = &pinctrl_z;
|
||||
};
|
||||
|
||||
config {
|
||||
u-boot,dm-pre-reloc;
|
||||
/* need PSCI for sysreset during board_f */
|
||||
psci {
|
||||
u-boot,dm-pre-proper;
|
||||
};
|
||||
|
||||
clocks {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
reboot {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
soc {
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
@ -39,6 +46,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
&bsec {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_csi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_hsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
@ -47,26 +62,81 @@
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_lse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_lsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_csi {
|
||||
&clk_lse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&rcc {
|
||||
&cpu0_opp_table {
|
||||
u-boot,dm-spl;
|
||||
opp-650000000 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
opp-800000000 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&gpioa {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&rcc_reboot {
|
||||
&gpiob {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioc {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioe {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioh {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioj {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiok {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioz {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* pre-reloc probe = reserve video frame buffer in video_reserve() */
|
||||
<dc {
|
||||
u-boot,dm-pre-proper;
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
@ -75,62 +145,22 @@
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioa {
|
||||
compatible = "st,stm32-gpio";
|
||||
&pwr {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiob {
|
||||
compatible = "st,stm32-gpio";
|
||||
&rcc {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioc {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
&sdmmc1 {
|
||||
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
&sdmmc2 {
|
||||
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
|
||||
};
|
||||
|
||||
&gpioe {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiog {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioh {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioi {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioj {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpiok {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&gpioz {
|
||||
compatible = "st,stm32-gpio";
|
||||
u-boot,dm-pre-reloc;
|
||||
&sdmmc3 {
|
||||
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
|
||||
};
|
||||
|
||||
173
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
Normal file
173
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
Normal file
@ -0,0 +1,173 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2018
|
||||
*/
|
||||
|
||||
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||
#include "stm32mp157-u-boot.dtsi"
|
||||
#include "stm32mp15-ddr3-1x4Gb-1066-binG.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
i2c3 = &i2c4;
|
||||
mmc0 = &sdmmc1;
|
||||
};
|
||||
config {
|
||||
u-boot,boot-led = "heartbeat";
|
||||
u-boot,error-led = "error";
|
||||
st,adc_usb_pd = <&adc1 18>, <&adc1 19>;
|
||||
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
led {
|
||||
red {
|
||||
label = "error";
|
||||
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
default-state = "off";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
blue {
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
st,digbypass;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&i2c4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&pmic {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&rcc {
|
||||
st,clksrc = <
|
||||
CLK_MPU_PLL1P
|
||||
CLK_AXI_PLL2P
|
||||
CLK_MCU_PLL3P
|
||||
CLK_PLL12_HSE
|
||||
CLK_PLL3_HSE
|
||||
CLK_PLL4_HSE
|
||||
CLK_RTC_LSE
|
||||
CLK_MCO1_DISABLED
|
||||
CLK_MCO2_DISABLED
|
||||
>;
|
||||
|
||||
st,clkdiv = <
|
||||
1 /*MPU*/
|
||||
0 /*AXI*/
|
||||
0 /*MCU*/
|
||||
1 /*APB1*/
|
||||
1 /*APB2*/
|
||||
1 /*APB3*/
|
||||
1 /*APB4*/
|
||||
2 /*APB5*/
|
||||
23 /*RTC*/
|
||||
0 /*MCO1*/
|
||||
0 /*MCO2*/
|
||||
>;
|
||||
|
||||
st,pkcs = <
|
||||
CLK_CKPER_HSE
|
||||
CLK_FMC_ACLK
|
||||
CLK_QSPI_ACLK
|
||||
CLK_ETH_DISABLED
|
||||
CLK_SDMMC12_PLL4P
|
||||
CLK_DSI_DSIPLL
|
||||
CLK_STGEN_HSE
|
||||
CLK_USBPHY_HSE
|
||||
CLK_SPI2S1_PLL3Q
|
||||
CLK_SPI2S23_PLL3Q
|
||||
CLK_SPI45_HSI
|
||||
CLK_SPI6_HSI
|
||||
CLK_I2C46_HSI
|
||||
CLK_SDMMC3_PLL4P
|
||||
CLK_USBO_USBPHY
|
||||
CLK_ADC_CKPER
|
||||
CLK_CEC_LSE
|
||||
CLK_I2C12_HSI
|
||||
CLK_I2C35_HSI
|
||||
CLK_UART1_HSI
|
||||
CLK_UART24_HSI
|
||||
CLK_UART35_HSI
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4R
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
CLK_SAI4_PLL3Q
|
||||
CLK_RNG1_LSI
|
||||
CLK_RNG2_LSI
|
||||
CLK_LPTIM1_PCLK1
|
||||
CLK_LPTIM23_PCLK3
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
frac = < 0x1400 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */
|
||||
pll4: st,pll@3 {
|
||||
cfg = < 3 98 5 7 7 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&uart4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
/* pull-up on rx to avoid floating level */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
767
arch/arm/dts/stm32mp157a-dk1.dts
Normal file
767
arch/arm/dts/stm32mp157a-dk1.dts
Normal file
@ -0,0 +1,767 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2018 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c.dtsi"
|
||||
#include "stm32mp157cac-pinctrl.dtsi"
|
||||
#include "stm32mp157c-m4-srm.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157A-DK1 Discovery Board";
|
||||
compatible = "st,stm32mp157a-dk1", "st,stm32mp157";
|
||||
|
||||
aliases {
|
||||
ethernet0 = ðernet0;
|
||||
serial0 = &uart4;
|
||||
serial1 = &usart3;
|
||||
serial2 = &uart7;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@c0000000 {
|
||||
reg = <0xc0000000 0x20000000>;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
retram: retram@0x38000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x38000000 0x10000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
mcuram: mcuram@0x30000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x30000000 0x40000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
mcuram2: mcuram2@0x10000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10000000 0x40000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
vdev0vring0: vdev0vring0@10040000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10040000 0x2000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
vdev0vring1: vdev0vring1@10042000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10042000 0x2000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
vdev0buffer: vdev0buffer@10044000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10044000 0x4000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
gpu_reserved: gpu@d4000000 {
|
||||
reg = <0xd4000000 0x4000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
|
||||
sram: sram@10050000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x10050000 0x10000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x10050000 0x10000>;
|
||||
|
||||
dma_pool: dma_pool@0 {
|
||||
reg = <0x0 0x10000>;
|
||||
pool;
|
||||
};
|
||||
};
|
||||
|
||||
led {
|
||||
compatible = "gpio-leds";
|
||||
blue {
|
||||
label = "heartbeat";
|
||||
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
|
||||
sound {
|
||||
compatible = "audio-graph-card";
|
||||
label = "STM32MP1-DK";
|
||||
routing =
|
||||
"Playback" , "MCLK",
|
||||
"Capture" , "MCLK",
|
||||
"MICL" , "Mic Bias";
|
||||
dais = <&sai2a_port &sai2b_port &i2s2_port>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usb_phy_tuning: usb-phy-tuning {
|
||||
st,hs-dc-level = <2>;
|
||||
st,fs-rftime-tuning;
|
||||
st,hs-rftime-reduction;
|
||||
st,hs-current-trim = <15>;
|
||||
st,hs-impedance-trim = <1>;
|
||||
st,squelch-level = <3>;
|
||||
st,hs-rx-offset = <2>;
|
||||
st,no-lsfs-sc;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_pwr_pins_a>;
|
||||
vdd-supply = <&vdd>;
|
||||
vdda-supply = <&vdd>;
|
||||
vref-supply = <&vrefbuf>;
|
||||
status = "disabled";
|
||||
adc1: adc@0 {
|
||||
/*
|
||||
* Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19.
|
||||
* Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
|
||||
* 5 * (56 + 47kOhms) * 5pF => 2.5us.
|
||||
* Use arbitrary margin here (e.g. 5µs).
|
||||
*/
|
||||
st,min-sample-time-nsecs = <5000>;
|
||||
/* AIN connector, USB Type-C CC1 & CC2 */
|
||||
st,adc-channels = <0 1 6 13 18 19>;
|
||||
status = "okay";
|
||||
};
|
||||
adc2: adc@100 {
|
||||
/* AIN connector, temp sensor, USB Type-C CC1 & CC2 */
|
||||
st,adc-channels = <0 1 2 6 12 18 19>;
|
||||
/* temperature sensor min sample time */
|
||||
st,min-sample-time-nsecs = <10000>;
|
||||
status = "okay";
|
||||
};
|
||||
adc_temp: temp {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&cec_pins_b>;
|
||||
pinctrl-1 = <&cec_pins_sleep_b>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&cpu0{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&cpu1{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&dma1 {
|
||||
sram = <&dma_pool>;
|
||||
};
|
||||
|
||||
&dma2 {
|
||||
sram = <&dma_pool>;
|
||||
};
|
||||
|
||||
&dts {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ðernet0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ðernet0_rgmii_pins_a>;
|
||||
pinctrl-1 = <ðernet0_rgmii_pins_sleep_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
phy-mode = "rgmii-id";
|
||||
max-speed = <1000>;
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c1_pins_a>;
|
||||
pinctrl-1 = <&i2c1_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <100>;
|
||||
i2c-scl-falling-time-ns = <7>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
cs42l51: cs42l51@4a {
|
||||
compatible = "cirrus,cs42l51";
|
||||
reg = <0x4a>;
|
||||
#sound-dai-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
VL-supply = <&v3v3>;
|
||||
VD-supply = <&v1v8_audio>;
|
||||
VA-supply = <&v1v8_audio>;
|
||||
VAHP-supply = <&v1v8_audio>;
|
||||
|
||||
reset-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>;
|
||||
|
||||
clocks = <&sai2a>;
|
||||
clock-names = "MCLK";
|
||||
|
||||
cs42l51_port: port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cs42l51_tx_endpoint: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&sai2a_endpoint>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
|
||||
cs42l51_rx_endpoint: endpoint@1 {
|
||||
reg = <1>;
|
||||
remote-endpoint = <&sai2b_endpoint>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hdmi-transmitter@39 {
|
||||
compatible = "sil,sii9022";
|
||||
reg = <0x39>;
|
||||
iovcc-supply = <&v3v3_hdmi>;
|
||||
cvcc12-supply = <&v1v2_hdmi>;
|
||||
reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
|
||||
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-parent = <&gpiog>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
sii9022_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
sii9022_tx_endpoint: endpoint {
|
||||
remote-endpoint = <&i2s2_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c4_pins_a>;
|
||||
pinctrl-1 = <&i2c4_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
clock-frequency = <400000>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
typec: stusb1600@28 {
|
||||
compatible = "st,stusb1600";
|
||||
reg = <0x28>;
|
||||
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-parent = <&gpioi>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&stusb1600_pins_a>;
|
||||
status = "okay";
|
||||
|
||||
typec_con: connector {
|
||||
compatible = "usb-c-connector";
|
||||
label = "USB-C";
|
||||
power-role = "dual";
|
||||
power-opmode = "default";
|
||||
};
|
||||
};
|
||||
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
wakeup-source;
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmic1-regulators";
|
||||
|
||||
ldo1-supply = <&v3v3>;
|
||||
ldo3-supply = <&vdd_ddr>;
|
||||
ldo6-supply = <&v3v3>;
|
||||
pwr_sw1-supply = <&bst_out>;
|
||||
pwr_sw2-supply = <&bst_out>;
|
||||
|
||||
vddcore: buck1 {
|
||||
regulator-name = "vddcore";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-always-on;
|
||||
regulator-initial-mode = <0>;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_ddr: buck2 {
|
||||
regulator-name = "vdd_ddr";
|
||||
regulator-min-microvolt = <1350000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-always-on;
|
||||
regulator-initial-mode = <0>;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd: buck3 {
|
||||
regulator-name = "vdd";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
st,mask-reset;
|
||||
regulator-initial-mode = <0>;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
v3v3: buck4 {
|
||||
regulator-name = "v3v3";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
regulator-initial-mode = <0>;
|
||||
};
|
||||
|
||||
v1v8_audio: ldo1 {
|
||||
regulator-name = "v1v8_audio";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO1 0>;
|
||||
|
||||
};
|
||||
|
||||
v3v3_hdmi: ldo2 {
|
||||
regulator-name = "v3v3_hdmi";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
regulator-name = "vdd_usb";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
};
|
||||
|
||||
vdda: ldo5 {
|
||||
regulator-name = "vdda";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
v1v2_hdmi: ldo6 {
|
||||
regulator-name = "v1v2_hdmi";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
regulator-active-discharge = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c5 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c5_pins_a>;
|
||||
pinctrl-1 = <&i2c5_pins_sleep_a>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&i2s2 {
|
||||
clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "i2sclk", "x8k", "x11k";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2s2_pins_a>;
|
||||
pinctrl-1 = <&i2s2_pins_sleep_a>;
|
||||
status = "okay";
|
||||
|
||||
i2s2_port: port {
|
||||
i2s2_endpoint: endpoint {
|
||||
remote-endpoint = <&sii9022_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ipcc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
timeout-sec = <32>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
<dc {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <<dc_pins_a>;
|
||||
pinctrl-1 = <<dc_pins_sleep_a>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep0_out: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&sii9022_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&m4_rproc {
|
||||
memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
|
||||
<&vdev0vring1>, <&vdev0buffer>;
|
||||
mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
|
||||
mbox-names = "vq0", "vq1", "shutdown";
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <68 1>;
|
||||
interrupt-names = "wdg";
|
||||
wakeup-source;
|
||||
recovery;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwr {
|
||||
pwr-regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
|
||||
pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
|
||||
status = "okay";
|
||||
|
||||
sai2a: audio-controller@4400b004 {
|
||||
#clock-cells = <0>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "okay";
|
||||
|
||||
sai2a_port: port {
|
||||
sai2a_endpoint: endpoint {
|
||||
remote-endpoint = <&cs42l51_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
dai-tdm-slot-width = <32>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sai2b: audio-controller@4400b024 {
|
||||
dma-names = "rx";
|
||||
st,sync = <&sai2a 2>;
|
||||
status = "okay";
|
||||
clocks = <&rcc SAI2_K>, <&sai2a>;
|
||||
clock-names = "sai_ck", "MCLK";
|
||||
|
||||
sai2b_port: port {
|
||||
sai2b_endpoint: endpoint {
|
||||
remote-endpoint = <&cs42l51_rx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
dai-tdm-slot-width = <32>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc1_b4_pins_a>;
|
||||
pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
|
||||
pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
|
||||
broken-cd;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc3 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc3_b4_pins_a>;
|
||||
pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
|
||||
pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
|
||||
broken-cd;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spi4 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spi4_pins_a>;
|
||||
pinctrl-1 = <&spi4_sleep_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spi5 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spi5_pins_a>;
|
||||
pinctrl-1 = <&spi5_sleep_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&timers1 {
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm1_pins_a>;
|
||||
pinctrl-1 = <&pwm1_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@0 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers3 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm3_pins_a>;
|
||||
pinctrl-1 = <&pwm3_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@2 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers4 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm4_pins_a &pwm4_pins_b>;
|
||||
pinctrl-1 = <&pwm4_sleep_pins_a &pwm4_sleep_pins_b>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@3 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers5 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm5_pins_a>;
|
||||
pinctrl-1 = <&pwm5_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@4 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers6 {
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
timer@5 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers12 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm12_pins_a>;
|
||||
pinctrl-1 = <&pwm12_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@11 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
pinctrl-names = "default", "sleep", "idle", "no_console_suspend";
|
||||
pinctrl-0 = <&uart4_pins_a>;
|
||||
pinctrl-1 = <&uart4_sleep_pins_a>;
|
||||
pinctrl-2 = <&uart4_idle_pins_a>;
|
||||
pinctrl-3 = <&uart4_pins_a>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart7 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&uart7_pins_a>;
|
||||
pinctrl-1 = <&uart7_sleep_pins_a>;
|
||||
pinctrl-2 = <&uart7_idle_pins_a>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usart3 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart3_pins_b>;
|
||||
pinctrl-1 = <&usart3_sleep_pins_b>;
|
||||
pinctrl-2 = <&usart3_idle_pins_b>;
|
||||
st,hw-flow-ctrl;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
phy-names = "usb";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
extcon = <&typec>;
|
||||
phys = <&usbphyc_port1 0>;
|
||||
phy-names = "usb2-phy";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc {
|
||||
vdd3v3-supply = <&vdd_usb>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
st,phy-tuning = <&usb_phy_tuning>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
st,phy-tuning = <&usb_phy_tuning>;
|
||||
};
|
||||
|
||||
&vrefbuf {
|
||||
regulator-min-microvolt = <2500000>;
|
||||
regulator-max-microvolt = <2500000>;
|
||||
vdda-supply = <&vdd>;
|
||||
status = "okay";
|
||||
};
|
||||
6
arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2018
|
||||
*/
|
||||
|
||||
#include "stm32mp157a-dk1-u-boot.dtsi"
|
||||
147
arch/arm/dts/stm32mp157c-dk2.dts
Normal file
147
arch/arm/dts/stm32mp157c-dk2.dts
Normal file
@ -0,0 +1,147 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2018 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157a-dk1.dts"
|
||||
#include <dt-bindings/rtc/rtc-stm32.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157C-DK2 Discovery Board";
|
||||
compatible = "st,stm32mp157c-dk2", "st,stm32mp157";
|
||||
|
||||
aliases {
|
||||
serial3 = &usart2;
|
||||
};
|
||||
|
||||
wifi_pwrseq: wifi-pwrseq {
|
||||
compatible = "mmc-pwrseq-simple";
|
||||
reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
dsi_in: endpoint {
|
||||
remote-endpoint = <<dc_ep1_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dsi_out: endpoint {
|
||||
remote-endpoint = <&panel_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
panel: panel@0 {
|
||||
compatible = "orisetech,otm8009a";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
|
||||
power-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
panel_in: endpoint {
|
||||
remote-endpoint = <&dsi_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
touchscreen@2a {
|
||||
compatible = "focaltech,ft6236";
|
||||
reg = <0x2a>;
|
||||
interrupts = <2 2>;
|
||||
interrupt-parent = <&gpiof>;
|
||||
interrupt-controller;
|
||||
touchscreen-size-x = <480>;
|
||||
touchscreen-size-y = <800>;
|
||||
panel = <&panel>;
|
||||
status = "okay";
|
||||
};
|
||||
touchscreen@38 {
|
||||
compatible = "focaltech,ft6336";
|
||||
reg = <0x38>;
|
||||
interrupts = <2 2>;
|
||||
interrupt-parent = <&gpiof>;
|
||||
interrupt-controller;
|
||||
touchscreen-size-x = <480>;
|
||||
touchscreen-size-y = <800>;
|
||||
panel = <&panel>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep1_out: endpoint@1 {
|
||||
reg = <1>;
|
||||
remote-endpoint = <&dsi_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&rtc {
|
||||
st,lsco = <RTC_OUT2_RMP>;
|
||||
pinctrl-0 = <&rtc_out2_rmp_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
/* Wifi */
|
||||
&sdmmc2 {
|
||||
arm,primecell-periphid = <0x10153180>;
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc2_b4_pins_b>;
|
||||
pinctrl-1 = <&sdmmc2_b4_od_pins_b>;
|
||||
pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
|
||||
non-removable;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
mmc-pwrseq = <&wifi_pwrseq>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
keep-power-in-suspend;
|
||||
status = "okay";
|
||||
|
||||
brcmf: bcrmf@1 {
|
||||
reg = <1>;
|
||||
compatible = "brcm,bcm4329-fmac";
|
||||
};
|
||||
};
|
||||
|
||||
/* Bluetooth */
|
||||
&usart2 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart2_pins_a>;
|
||||
pinctrl-1 = <&usart2_sleep_pins_a>;
|
||||
pinctrl-2 = <&usart2_idle_pins_a>;
|
||||
st,hw-flow-ctrl;
|
||||
status = "okay";
|
||||
|
||||
bluetooth {
|
||||
shutdown-gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
|
||||
compatible = "brcm,bcm43438-bt";
|
||||
max-speed = <3000000>;
|
||||
};
|
||||
};
|
||||
@ -9,44 +9,38 @@
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
i2c3 = &i2c4;
|
||||
mmc0 = &sdmmc1;
|
||||
mmc1 = &sdmmc2;
|
||||
i2c3 = &i2c4;
|
||||
};
|
||||
|
||||
config {
|
||||
u-boot,boot-led = "heartbeat";
|
||||
u-boot,error-led = "error";
|
||||
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
red {
|
||||
label = "stm32mp:red:status";
|
||||
label = "error";
|
||||
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
default-state = "off";
|
||||
status = "okay";
|
||||
};
|
||||
green {
|
||||
label = "stm32mp:green:user";
|
||||
gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
default-state = "on";
|
||||
};
|
||||
orange {
|
||||
label = "stm32mp:orange:status";
|
||||
gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "off";
|
||||
};
|
||||
|
||||
blue {
|
||||
label = "stm32mp:blue:user";
|
||||
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart4_pins_a {
|
||||
&clk_hse {
|
||||
st,digbypass;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4_pins_a {
|
||||
@ -56,19 +50,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&pmic {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* CLOCK init */
|
||||
&rcc {
|
||||
st,clksrc = <
|
||||
CLK_MPU_PLL1P
|
||||
@ -101,7 +86,7 @@
|
||||
CLK_FMC_ACLK
|
||||
CLK_QSPI_ACLK
|
||||
CLK_ETH_DISABLED
|
||||
CLK_SDMMC12_PLL3R
|
||||
CLK_SDMMC12_PLL4P
|
||||
CLK_DSI_DSIPLL
|
||||
CLK_STGEN_HSE
|
||||
CLK_USBPHY_HSE
|
||||
@ -110,7 +95,7 @@
|
||||
CLK_SPI45_HSI
|
||||
CLK_SPI6_HSI
|
||||
CLK_I2C46_HSI
|
||||
CLK_SDMMC3_PLL3R
|
||||
CLK_SDMMC3_PLL4P
|
||||
CLK_USBO_USBPHY
|
||||
CLK_ADC_CKPER
|
||||
CLK_CEC_LSE
|
||||
@ -121,26 +106,19 @@
|
||||
CLK_UART35_HSI
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL3Q
|
||||
CLK_FDCAN_PLL4Q
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4R
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
CLK_SAI4_PLL3Q
|
||||
CLK_RNG1_CSI
|
||||
CLK_RNG2_CSI
|
||||
CLK_RNG1_LSI
|
||||
CLK_RNG2_LSI
|
||||
CLK_LPTIM1_PCLK1
|
||||
CLK_LPTIM23_PCLK3
|
||||
CLK_LPTIM45_PCLK3
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1300.0 MHz => P = 650 (CPU) */
|
||||
pll1: st,pll@0 {
|
||||
cfg = < 2 80 0 0 0 PQR(1,0,0) >;
|
||||
frac = < 0x800 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
@ -148,44 +126,54 @@
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 786.4 MHz => P = 197, Q = 49, R = 98 */
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
cfg = < 2 97 3 15 7 PQR(1,1,1) >;
|
||||
frac = < 0x9ba >;
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 508.0 MHz => P = 56, Q = 56, R = 56 */
|
||||
/* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */
|
||||
pll4: st,pll@3 {
|
||||
cfg = < 5 126 8 8 8 PQR(1,1,1) >;
|
||||
cfg = < 3 98 5 7 7 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
/* SPL part **************************************/
|
||||
/* MMC1 boot */
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1_dir_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
/* MMC2 boot */
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1_dir_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc2_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
@ -197,6 +185,18 @@
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
u-boot,dm-spl;
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&uart4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
/* pull-up on rx to avoid floating level */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
@ -6,22 +6,96 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c.dtsi"
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/mfd/st,stpmu1.h>
|
||||
#include "stm32mp157caa-pinctrl.dtsi"
|
||||
#include "stm32mp157c-m4-srm.dtsi"
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157C eval daughter";
|
||||
compatible = "st,stm32mp157c-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial3:115200n8";
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@c0000000 {
|
||||
reg = <0xC0000000 0x40000000>;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
retram: retram@0x38000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x38000000 0x10000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
mcuram: mcuram@0x30000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x30000000 0x40000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
mcuram2: mcuram2@0x10000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10000000 0x40000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
vdev0vring0: vdev0vring0@10040000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10040000 0x2000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
vdev0vring1: vdev0vring1@10042000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10042000 0x2000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
vdev0buffer: vdev0buffer@10044000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10044000 0x4000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
gpu_reserved: gpu@e8000000 {
|
||||
reg = <0xe8000000 0x8000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
};
|
||||
|
||||
sram: sram@10050000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x10050000 0x10000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x10050000 0x10000>;
|
||||
|
||||
dma_pool: dma_pool@0 {
|
||||
reg = <0x0 0x10000>;
|
||||
pool;
|
||||
};
|
||||
};
|
||||
|
||||
led {
|
||||
compatible = "gpio-leds";
|
||||
blue {
|
||||
label = "heartbeat";
|
||||
gpios = <&gpiod 9 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
|
||||
sd_switch: regulator-sd_switch {
|
||||
compatible = "regulator-gpio";
|
||||
regulator-name = "sd_switch";
|
||||
@ -36,40 +110,93 @@
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
&adc {
|
||||
/* ANA0, ANA1 are dedicated pins and don't need pinctrl: only in6. */
|
||||
vdd-supply = <&vdd>;
|
||||
vdda-supply = <&vdda>;
|
||||
vref-supply = <&vdda>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timers6 {
|
||||
status = "okay";
|
||||
timer@5 {
|
||||
adc1: adc@0 {
|
||||
st,adc-channels = <0 1>;
|
||||
/* 16.5 ck_cycles sampling time */
|
||||
st,min-sample-time-nsecs = <400>;
|
||||
status = "okay";
|
||||
};
|
||||
jadc1: jadc@0 {
|
||||
st,adc-channels = <0 1>;
|
||||
/* 16.5 ck_cycles sampling time */
|
||||
st,min-sample-time-nsecs = <400>;
|
||||
status = "okay";
|
||||
};
|
||||
/* temperature sensor on adc2 */
|
||||
adc2: adc@100 {
|
||||
status = "okay";
|
||||
};
|
||||
adc_temp: temp {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
&cpu0{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&cpu1{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&dac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&dac_ch1_pins_a &dac_ch2_pins_a>;
|
||||
vref-supply = <&vdda>;
|
||||
status = "okay";
|
||||
dac1: dac@1 {
|
||||
status = "okay";
|
||||
};
|
||||
dac2: dac@2 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&dma1 {
|
||||
sram = <&dma_pool>;
|
||||
};
|
||||
|
||||
&dma2 {
|
||||
sram = <&dma_pool>;
|
||||
};
|
||||
|
||||
&dts {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c4_pins_a>;
|
||||
pinctrl-1 = <&i2c4_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
clock-frequency = <400000>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
pmic: stpmu1@33 {
|
||||
compatible = "st,stpmu1";
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts = <0 2>;
|
||||
interrupt-parent = <&gpioa>;
|
||||
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
|
||||
st,main_control_register = <0x04>;
|
||||
st,vin_control_register = <0xc0>;
|
||||
st,usb_control_register = <0x30>;
|
||||
wakeup-source;
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmu1-regulators";
|
||||
|
||||
compatible = "st,stpmic1-regulators";
|
||||
ldo1-supply = <&v3v3>;
|
||||
ldo2-supply = <&v3v3>;
|
||||
ldo3-supply = <&vdd_ddr>;
|
||||
@ -80,23 +207,11 @@
|
||||
|
||||
vddcore: buck1 {
|
||||
regulator-name = "vddcore";
|
||||
regulator-min-microvolt = <800000>;
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-always-on;
|
||||
regulator-initial-mode = <2>;
|
||||
regulator-initial-mode = <0>;
|
||||
regulator-over-current-protection;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-on-in-suspend;
|
||||
regulator-suspend-microvolt = <1200000>;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd_ddr: buck2 {
|
||||
@ -104,22 +219,8 @@
|
||||
regulator-min-microvolt = <1350000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-always-on;
|
||||
regulator-initial-mode = <2>;
|
||||
regulator-initial-mode = <0>;
|
||||
regulator-over-current-protection;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <1350000>;
|
||||
regulator-on-in-suspend;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-suspend-microvolt = <1350000>;
|
||||
regulator-on-in-suspend;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd: buck3 {
|
||||
@ -127,46 +228,18 @@
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
st,mask_reset;
|
||||
regulator-initial-mode = <8>;
|
||||
st,mask-reset;
|
||||
regulator-initial-mode = <0>;
|
||||
regulator-over-current-protection;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <3300000>;
|
||||
regulator-on-in-suspend;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-suspend-microvolt = <3300000>;
|
||||
regulator-on-in-suspend;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-suspend-microvolt = <3300000>;
|
||||
regulator-on-in-suspend;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
v3v3: buck4 {
|
||||
regulator-name = "v3v3";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
regulator-initial-mode = <8>;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <3300000>;
|
||||
regulator-unchanged-in-suspend;
|
||||
regulator-mode = <8>;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-initial-mode = <0>;
|
||||
};
|
||||
|
||||
vdda: ldo1 {
|
||||
@ -174,18 +247,6 @@
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO1 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <2900000>;
|
||||
regulator-unchanged-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
v2v8: ldo2 {
|
||||
@ -193,36 +254,14 @@
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <2800000>;
|
||||
regulator-unchanged-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <0000000>;
|
||||
regulator-max-microvolt = <1000000>;
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
@ -230,17 +269,6 @@
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-unchanged-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd_sd: ldo5 {
|
||||
@ -248,19 +276,7 @@
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
regulator-boot-on;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <2900000>;
|
||||
regulator-unchanged-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
v1v8: ldo6 {
|
||||
@ -268,69 +284,92 @@
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-suspend-microvolt = <1800000>;
|
||||
regulator-unchanged-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
|
||||
regulator-state-standby {
|
||||
regulator-on-in-suspend;
|
||||
};
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
};
|
||||
regulator-state-disk {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
};
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
regulator-active-discharge;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
regulator-active-discharge;
|
||||
regulator-active-discharge = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ipcc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
timeout-sec = <32>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&m4_rproc {
|
||||
memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
|
||||
<&vdev0vring1>, <&vdev0buffer>;
|
||||
mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
|
||||
mbox-names = "vq0", "vq1", "shutdown";
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <68 1>;
|
||||
interrupt-names = "wdg";
|
||||
wakeup-source;
|
||||
recovery;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwr {
|
||||
pwr-supply = <&vdd>;
|
||||
pwr-regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
|
||||
broken-cd;
|
||||
st,dirpol;
|
||||
st,negedge;
|
||||
st,pin-ckin;
|
||||
st,sig-dir;
|
||||
st,neg-edge;
|
||||
st,use-ckin;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&vdd_sd>;
|
||||
vqmmc-supply = <&sd_switch>;
|
||||
@ -343,36 +382,46 @@
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
|
||||
pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_a>;
|
||||
pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_a>;
|
||||
non-removable;
|
||||
no-sd;
|
||||
no-sdio;
|
||||
st,dirpol;
|
||||
st,negedge;
|
||||
st,neg-edge;
|
||||
bus-width = <8>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
vqmmc-supply = <&vdd>;
|
||||
vqmmc-supply = <&v3v3>;
|
||||
mmc-ddr-3_3v;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timers6 {
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
timer@5 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "default", "sleep", "idle", "no_console_suspend";
|
||||
pinctrl-0 = <&uart4_pins_a>;
|
||||
pinctrl-1 = <&uart4_sleep_pins_a>;
|
||||
pinctrl-2 = <&uart4_idle_pins_a>;
|
||||
pinctrl-3 = <&uart4_pins_a>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
usb33d-supply = <&usb33>;
|
||||
vbus-supply = <&vbus_otg>;
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
vdda1v1-supply = <®11>;
|
||||
vdda1v8-supply = <®18>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
vdda1v1-supply = <®11>;
|
||||
vdda1v8-supply = <®18>;
|
||||
&usbphyc {
|
||||
vdd3v3-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
@ -7,29 +7,23 @@
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
spi0 = &qspi;
|
||||
gpio26 = &stmfx_pinctrl;
|
||||
i2c1 = &i2c2;
|
||||
i2c4 = &i2c5;
|
||||
pinctrl2 = &stmfx_pinctrl;
|
||||
spi0 = &qspi;
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
compatible = "spi-flash";
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&flash1 {
|
||||
compatible = "spi-flash";
|
||||
};
|
||||
|
||||
&v3v3 {
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
g-tx-fifo-size = <576>;
|
||||
};
|
||||
|
||||
/* SPL part **************************************/
|
||||
&qspi {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
@ -60,8 +54,3 @@
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
|
||||
@ -6,44 +6,555 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c-ed1.dts"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/soc/stm32-hdp.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
|
||||
compatible = "st,stm32mp157c-ev1", "st,stm32mp157c-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial1 = &usart3;
|
||||
ethernet0 = ðernet0;
|
||||
};
|
||||
|
||||
clocks {
|
||||
clk_ext_camera: clk-ext-camera {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <24000000>;
|
||||
};
|
||||
};
|
||||
|
||||
joystick {
|
||||
compatible = "gpio-keys";
|
||||
#size-cells = <0>;
|
||||
pinctrl-0 = <&joystick_pins>;
|
||||
pinctrl-names = "default";
|
||||
button-0 {
|
||||
label = "JoySel";
|
||||
linux,code = <KEY_ENTER>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <0 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-1 {
|
||||
label = "JoyDown";
|
||||
linux,code = <KEY_DOWN>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <1 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-2 {
|
||||
label = "JoyLeft";
|
||||
linux,code = <KEY_LEFT>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <2 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-3 {
|
||||
label = "JoyRight";
|
||||
linux,code = <KEY_RIGHT>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <3 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-4 {
|
||||
label = "JoyUp";
|
||||
linux,code = <KEY_UP>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
};
|
||||
|
||||
panel_backlight: panel-backlight {
|
||||
compatible = "gpio-backlight";
|
||||
gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
|
||||
default-on;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
spdif_out: spdif-out {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "linux,spdif-dit";
|
||||
status = "okay";
|
||||
|
||||
spdif_out_port: port {
|
||||
spdif_out_endpoint: endpoint {
|
||||
remote-endpoint = <&sai4a_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
spdif_in: spdif-in {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "linux,spdif-dir";
|
||||
status = "okay";
|
||||
|
||||
spdif_in_port: port {
|
||||
spdif_in_endpoint: endpoint {
|
||||
remote-endpoint = <&spdifrx_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sound: sound {
|
||||
compatible = "audio-graph-card";
|
||||
label = "STM32MP1-EV";
|
||||
routing =
|
||||
"AIF1CLK" , "MCLK1",
|
||||
"AIF2CLK" , "MCLK1",
|
||||
"IN1LN" , "MICBIAS2",
|
||||
"DMIC2DAT" , "MICBIAS1",
|
||||
"DMIC1DAT" , "MICBIAS1";
|
||||
dais = <&sai2a_port &sai2b_port &sai4a_port &spdifrx_port
|
||||
&dfsdm0_port &dfsdm1_port &dfsdm2_port &dfsdm3_port>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
dmic0: dmic-0 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic0_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dmic1: dmic-1 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic1_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dmic2: dmic-2 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic2_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dmic3: dmic-3 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic3_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
usb_phy_tuning: usb-phy-tuning {
|
||||
st,hs-dc-level = <2>;
|
||||
st,fs-rftime-tuning;
|
||||
st,hs-rftime-reduction;
|
||||
st,hs-current-trim = <15>;
|
||||
st,hs-impedance-trim = <1>;
|
||||
st,squelch-level = <3>;
|
||||
st,hs-rx-offset = <2>;
|
||||
st,no-lsfs-sc;
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&cec_pins_a>;
|
||||
pinctrl-1 = <&cec_pins_sleep_a>;
|
||||
};
|
||||
|
||||
&dcmi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dcmi_pins_a>;
|
||||
pinctrl-1 = <&dcmi_sleep_pins_a>;
|
||||
|
||||
port {
|
||||
dcmi_0: endpoint {
|
||||
remote-endpoint = <&ov5640_0>;
|
||||
bus-width = <8>;
|
||||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
pclk-sample = <1>;
|
||||
pclk-max-frequency = <77000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&dfsdm {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dfsdm_clkout_pins_a
|
||||
&dfsdm_data1_pins_a &dfsdm_data3_pins_a>;
|
||||
pinctrl-1 = <&dfsdm_clkout_sleep_pins_a
|
||||
&dfsdm_data1_sleep_pins_a &dfsdm_data3_sleep_pins_a>;
|
||||
spi-max-frequency = <2048000>;
|
||||
|
||||
clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
|
||||
clock-names = "dfsdm", "audio";
|
||||
status = "okay";
|
||||
|
||||
dfsdm0: filter@0 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <3>;
|
||||
st,adc-channel-names = "dmic_u1";
|
||||
st,adc-channel-types = "SPI_R";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm0: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm0 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm0_port: port {
|
||||
dfsdm_endpoint0: endpoint {
|
||||
remote-endpoint = <&dmic0_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dfsdm1: filter@1 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <1>;
|
||||
st,adc-channel-names = "dmic_u2";
|
||||
st,adc-channel-types = "SPI_F";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm1: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm1 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm1_port: port {
|
||||
dfsdm_endpoint1: endpoint {
|
||||
remote-endpoint = <&dmic1_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dfsdm2: filter@2 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <3>;
|
||||
st,adc-channel-names = "dmic_u3";
|
||||
st,adc-channel-types = "SPI_F";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm2: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm2 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm2_port: port {
|
||||
dfsdm_endpoint2: endpoint {
|
||||
remote-endpoint = <&dmic2_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dfsdm3: filter@3 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <1>;
|
||||
st,adc-channel-names = "dmic_u4";
|
||||
st,adc-channel-types = "SPI_R";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm3: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm3 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm3_port: port {
|
||||
dfsdm_endpoint3: endpoint {
|
||||
remote-endpoint = <&dmic3_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
dsi_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dsi_out: endpoint {
|
||||
remote-endpoint = <&dsi_panel_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
panel_dsi: panel-dsi@0 {
|
||||
compatible = "raydium,rm68200";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
|
||||
power-supply = <&v3v3>;
|
||||
backlight = <&panel_backlight>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dsi_panel_in: endpoint {
|
||||
remote-endpoint = <&dsi_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ðernet0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ðernet0_rgmii_pins_a>;
|
||||
pinctrl-1 = <ðernet0_rgmii_pins_sleep_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
phy-mode = "rgmii-id";
|
||||
max-speed = <1000>;
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&fmc {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&fmc_pins_a>;
|
||||
pinctrl-1 = <&fmc_sleep_pins_a>;
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
nand: nand@0 {
|
||||
reg = <0>;
|
||||
nand-on-flash-bbt;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&hdp {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&hdp0_pins_a &hdp6_pins_a &hdp7_pins_a>;
|
||||
pinctrl-1 = <&hdp0_pins_sleep_a &hdp6_pins_sleep_a &hdp7_pins_sleep_a>;
|
||||
status = "disabled";
|
||||
|
||||
muxing-hdp = <(STM32_HDP(0, HDP0_GPOVAL_0) |
|
||||
STM32_HDP(6, HDP6_GPOVAL_6) |
|
||||
STM32_HDP(7, HDP7_GPOVAL_7))>;
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c2_pins_a>;
|
||||
pinctrl-1 = <&i2c2_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
wm8994: wm8994@1b {
|
||||
compatible = "wlf,wm8994";
|
||||
#sound-dai-cells = <0>;
|
||||
reg = <0x1b>;
|
||||
status = "okay";
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
DBVDD-supply = <&vdd>;
|
||||
SPKVDD1-supply = <&vdd>;
|
||||
SPKVDD2-supply = <&vdd>;
|
||||
AVDD2-supply = <&v1v8>;
|
||||
CPVDD-supply = <&v1v8>;
|
||||
|
||||
wlf,ldoena-always-driven;
|
||||
|
||||
clocks = <&sai2a>;
|
||||
clock-names = "MCLK1";
|
||||
|
||||
wlf,gpio-cfg = <0x8101 0xa100 0xa100 0xa100 0xa101 0xa101 0xa100 0xa101 0xa101 0xa101 0xa101>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
wm8994_tx_port: port@0 {
|
||||
reg = <0>;
|
||||
wm8994_tx_endpoint: endpoint {
|
||||
remote-endpoint = <&sai2a_endpoint>;
|
||||
};
|
||||
};
|
||||
|
||||
wm8994_rx_port: port@1 {
|
||||
reg = <1>;
|
||||
wm8994_rx_endpoint: endpoint {
|
||||
remote-endpoint = <&sai2b_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ov5640: camera@3c {
|
||||
compatible = "ovti,ov5640";
|
||||
reg = <0x3c>;
|
||||
clocks = <&clk_ext_camera>;
|
||||
clock-names = "xclk";
|
||||
DOVDD-supply = <&v2v8>;
|
||||
powerdown-gpios = <&stmfx_pinctrl 18 (GPIO_ACTIVE_HIGH | GPIO_PUSH_PULL)>;
|
||||
reset-gpios = <&stmfx_pinctrl 19 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
|
||||
rotation = <180>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
ov5640_0: endpoint {
|
||||
remote-endpoint = <&dcmi_0>;
|
||||
bus-width = <8>;
|
||||
data-shift = <2>; /* lines 9:2 are used */
|
||||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
pclk-sample = <1>;
|
||||
pclk-max-frequency = <77000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
stmfx: stmfx@42 {
|
||||
compatible = "st,stmfx-0300";
|
||||
reg = <0x42>;
|
||||
interrupts = <8 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&gpioi>;
|
||||
vdd-supply = <&v3v3>;
|
||||
|
||||
stmfx_pinctrl: stmfx-pin-controller {
|
||||
compatible = "st,stmfx-0300-pinctrl";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-ranges = <&stmfx_pinctrl 0 0 24>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hog_pins>;
|
||||
|
||||
hog_pins: hog {
|
||||
pins = "gpio14";
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
joystick_pins: joystick {
|
||||
pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gt9147: goodix_ts@5d {
|
||||
compatible = "goodix,gt9147";
|
||||
reg = <0x5d>;
|
||||
panel = <&panel_dsi>;
|
||||
status = "okay";
|
||||
|
||||
irq-gpios = <&stmfx_pinctrl 14 GPIO_ACTIVE_HIGH>;
|
||||
irq-flags = <IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pmic: stpmic@33 {
|
||||
regulators {
|
||||
v1v8: ldo6 {
|
||||
regulator-enable-ramp-delay = <300000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c5 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c5_pins_a>;
|
||||
pinctrl-1 = <&i2c5_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep0_out: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&dsi_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&m_can1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&m_can1_pins_a>;
|
||||
pinctrl-1 = <&m_can1_sleep_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qspi {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a &qspi_bk2_pins_a>;
|
||||
pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a &qspi_bk2_sleep_pins_a>;
|
||||
reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
flash0: mx66l51235l@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
@ -52,6 +563,7 @@
|
||||
};
|
||||
|
||||
flash1: mx66l51235l@1 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <1>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
@ -60,11 +572,110 @@
|
||||
};
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_a>;
|
||||
pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_a>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
status = "okay";
|
||||
|
||||
sai2a: audio-controller@4400b004 {
|
||||
#clock-cells = <0>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "okay";
|
||||
|
||||
sai2a_port: port {
|
||||
sai2a_endpoint: endpoint {
|
||||
remote-endpoint = <&wm8994_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sai2b: audio-controller@4400b024 {
|
||||
dma-names = "rx";
|
||||
clocks = <&rcc SAI2_K>, <&sai2a>;
|
||||
clock-names = "sai_ck", "MCLK";
|
||||
status = "okay";
|
||||
|
||||
sai2b_port: port {
|
||||
sai2b_endpoint: endpoint {
|
||||
remote-endpoint = <&wm8994_rx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sai4 {
|
||||
clocks = <&rcc SAI4>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
status = "okay";
|
||||
|
||||
sai4a: audio-controller@50027004 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai4a_pins_a>;
|
||||
pinctrl-1 = <&sai4a_sleep_pins_a>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI4_K>;
|
||||
clock-names = "sai_ck";
|
||||
st,iec60958;
|
||||
status = "okay";
|
||||
|
||||
sai4a_port: port {
|
||||
sai4a_endpoint: endpoint {
|
||||
remote-endpoint = <&spdif_out_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc3 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc3_b4_pins_a>;
|
||||
pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
|
||||
pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
broken-cd;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spdifrx {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spdifrx_pins_a>;
|
||||
pinctrl-1 = <&spdifrx_pins_a>;
|
||||
status = "okay";
|
||||
|
||||
spdifrx_port: port {
|
||||
spdifrx_endpoint: endpoint {
|
||||
remote-endpoint = <&spdif_in_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spi1_pins_a>;
|
||||
pinctrl-1 = <&spi1_sleep_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&timers2 {
|
||||
status = "disabled";
|
||||
/* spare dmas for other usage (un-delete to enable pwm capture) */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm2_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-1 = <&pwm2_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@1 {
|
||||
@ -74,9 +685,12 @@
|
||||
|
||||
&timers8 {
|
||||
status = "disabled";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm8_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-1 = <&pwm8_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@7 {
|
||||
@ -86,9 +700,12 @@
|
||||
|
||||
&timers12 {
|
||||
status = "disabled";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm12_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-1 = <&pwm12_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@11 {
|
||||
@ -96,6 +713,15 @@
|
||||
};
|
||||
};
|
||||
|
||||
&usart3 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart3_pins_a>;
|
||||
pinctrl-1 = <&usart3_sleep_pins_a>;
|
||||
pinctrl-2 = <&usart3_idle_pins_a>;
|
||||
st,hw-flow-ctrl;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
phy-names = "usb";
|
||||
@ -114,3 +740,11 @@
|
||||
&usbphyc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
st,phy-tuning = <&usb_phy_tuning>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
st,phy-tuning = <&usb_phy_tuning>;
|
||||
};
|
||||
|
||||
961
arch/arm/dts/stm32mp157c-m4-srm.dtsi
Normal file
961
arch/arm/dts/stm32mp157c-m4-srm.dtsi
Normal file
@ -0,0 +1,961 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Fabien Dessenne <fabien.dessenne@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
m4_adc1_in6_pins_a: m4-adc1-in6 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 12, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_adc12_ain_pins_a: m4-adc12-ain-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 3, RSVD)>, /* ADC1 in13 */
|
||||
<STM32_PINMUX('F', 12, RSVD)>, /* ADC1 in6 */
|
||||
<STM32_PINMUX('F', 13, RSVD)>, /* ADC2 in2 */
|
||||
<STM32_PINMUX('F', 14, RSVD)>; /* ADC2 in6 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_adc12_usb_pwr_pins_a: m4-adc12-usb-pwr-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 4, RSVD)>, /* ADC12 in18 */
|
||||
<STM32_PINMUX('A', 5, RSVD)>; /* ADC12 in19 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_cec_pins_a: m4-cec-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 15, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_cec_pins_b: m4-cec-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 6, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_dac_ch1_pins_a: m4-dac-ch1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 4, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_dac_ch2_pins_a: m4-dac-ch2 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 5, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_dcmi_pins_a: m4-dcmi-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 8, RSVD)>,/* DCMI_HSYNC */
|
||||
<STM32_PINMUX('B', 7, RSVD)>,/* DCMI_VSYNC */
|
||||
<STM32_PINMUX('A', 6, RSVD)>,/* DCMI_PIXCLK */
|
||||
<STM32_PINMUX('H', 9, RSVD)>,/* DCMI_D0 */
|
||||
<STM32_PINMUX('H', 10, RSVD)>,/* DCMI_D1 */
|
||||
<STM32_PINMUX('H', 11, RSVD)>,/* DCMI_D2 */
|
||||
<STM32_PINMUX('H', 12, RSVD)>,/* DCMI_D3 */
|
||||
<STM32_PINMUX('H', 14, RSVD)>,/* DCMI_D4 */
|
||||
<STM32_PINMUX('I', 4, RSVD)>,/* DCMI_D5 */
|
||||
<STM32_PINMUX('B', 8, RSVD)>,/* DCMI_D6 */
|
||||
<STM32_PINMUX('E', 6, RSVD)>,/* DCMI_D7 */
|
||||
<STM32_PINMUX('I', 1, RSVD)>,/* DCMI_D8 */
|
||||
<STM32_PINMUX('H', 7, RSVD)>,/* DCMI_D9 */
|
||||
<STM32_PINMUX('I', 3, RSVD)>,/* DCMI_D10 */
|
||||
<STM32_PINMUX('H', 15, RSVD)>;/* DCMI_D11 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_dfsdm_clkout_pins_a: m4-dfsdm-clkout-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 13, RSVD)>; /* DFSDM_CKOUT */
|
||||
};
|
||||
};
|
||||
|
||||
m4_dfsdm_data1_pins_a: m4-dfsdm-data1-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 3, RSVD)>; /* DFSDM_DATA1 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_dfsdm_data3_pins_a: m4-dfsdm-data3-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 13, RSVD)>; /* DFSDM_DATA3 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_ethernet0_rgmii_pins_a: m4-rgmii-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 5, RSVD)>, /* ETH_RGMII_CLK125 */
|
||||
<STM32_PINMUX('G', 4, RSVD)>, /* ETH_RGMII_GTX_CLK */
|
||||
<STM32_PINMUX('G', 13, RSVD)>, /* ETH_RGMII_TXD0 */
|
||||
<STM32_PINMUX('G', 14, RSVD)>, /* ETH_RGMII_TXD1 */
|
||||
<STM32_PINMUX('C', 2, RSVD)>, /* ETH_RGMII_TXD2 */
|
||||
<STM32_PINMUX('E', 2, RSVD)>, /* ETH_RGMII_TXD3 */
|
||||
<STM32_PINMUX('B', 11, RSVD)>, /* ETH_RGMII_TX_CTL */
|
||||
<STM32_PINMUX('C', 1, RSVD)>, /* ETH_MDC */
|
||||
<STM32_PINMUX('A', 2, RSVD)>, /* ETH_MDIO */
|
||||
<STM32_PINMUX('C', 4, RSVD)>, /* ETH_RGMII_RXD0 */
|
||||
<STM32_PINMUX('C', 5, RSVD)>, /* ETH_RGMII_RXD1 */
|
||||
<STM32_PINMUX('B', 0, RSVD)>, /* ETH_RGMII_RXD2 */
|
||||
<STM32_PINMUX('B', 1, RSVD)>, /* ETH_RGMII_RXD3 */
|
||||
<STM32_PINMUX('A', 1, RSVD)>, /* ETH_RGMII_RX_CLK */
|
||||
<STM32_PINMUX('A', 7, RSVD)>; /* ETH_RGMII_RX_CTL */
|
||||
};
|
||||
};
|
||||
|
||||
m4_fmc_pins_a: m4-fmc-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 4, RSVD)>, /* FMC_NOE */
|
||||
<STM32_PINMUX('D', 5, RSVD)>, /* FMC_NWE */
|
||||
<STM32_PINMUX('D', 11, RSVD)>, /* FMC_A16_FMC_CLE */
|
||||
<STM32_PINMUX('D', 12, RSVD)>, /* FMC_A17_FMC_ALE */
|
||||
<STM32_PINMUX('D', 14, RSVD)>, /* FMC_D0 */
|
||||
<STM32_PINMUX('D', 15, RSVD)>, /* FMC_D1 */
|
||||
<STM32_PINMUX('D', 0, RSVD)>, /* FMC_D2 */
|
||||
<STM32_PINMUX('D', 1, RSVD)>, /* FMC_D3 */
|
||||
<STM32_PINMUX('E', 7, RSVD)>, /* FMC_D4 */
|
||||
<STM32_PINMUX('E', 8, RSVD)>, /* FMC_D5 */
|
||||
<STM32_PINMUX('E', 9, RSVD)>, /* FMC_D6 */
|
||||
<STM32_PINMUX('E', 10, RSVD)>, /* FMC_D7 */
|
||||
<STM32_PINMUX('G', 9, RSVD)>, /* FMC_NE2_FMC_NCE */
|
||||
<STM32_PINMUX('D', 6, RSVD)>; /* FMC_NWAIT */
|
||||
};
|
||||
};
|
||||
|
||||
m4_hdp0_pins_a: m4-hdp0-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 12, RSVD)>; /* HDP0 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_hdp6_pins_a: m4-hdp6-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('K', 5, RSVD)>; /* HDP6 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_hdp7_pins_a: m4-hdp7-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('K', 6, RSVD)>; /* HDP7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2c1_pins_a: m4-i2c1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 12, RSVD)>, /* I2C1_SCL */
|
||||
<STM32_PINMUX('F', 15, RSVD)>; /* I2C1_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2c2_pins_a: m4-i2c2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 4, RSVD)>, /* I2C2_SCL */
|
||||
<STM32_PINMUX('H', 5, RSVD)>; /* I2C2_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2c5_pins_a: m4-i2c5-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 11, RSVD)>, /* I2C5_SCL */
|
||||
<STM32_PINMUX('A', 12, RSVD)>; /* I2C5_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2s2_pins_a: m4-i2s2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 3, RSVD)>, /* I2S2_SDO */
|
||||
<STM32_PINMUX('B', 9, RSVD)>, /* I2S2_WS */
|
||||
<STM32_PINMUX('A', 9, RSVD)>; /* I2S2_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_ltdc_pins_a: m4-ltdc-a-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 7, RSVD)>, /* LCD_CLK */
|
||||
<STM32_PINMUX('I', 10, RSVD)>, /* LCD_HSYNC */
|
||||
<STM32_PINMUX('I', 9, RSVD)>, /* LCD_VSYNC */
|
||||
<STM32_PINMUX('F', 10, RSVD)>, /* LCD_DE */
|
||||
<STM32_PINMUX('H', 2, RSVD)>, /* LCD_R0 */
|
||||
<STM32_PINMUX('H', 3, RSVD)>, /* LCD_R1 */
|
||||
<STM32_PINMUX('H', 8, RSVD)>, /* LCD_R2 */
|
||||
<STM32_PINMUX('H', 9, RSVD)>, /* LCD_R3 */
|
||||
<STM32_PINMUX('H', 10, RSVD)>, /* LCD_R4 */
|
||||
<STM32_PINMUX('C', 0, RSVD)>, /* LCD_R5 */
|
||||
<STM32_PINMUX('H', 12, RSVD)>, /* LCD_R6 */
|
||||
<STM32_PINMUX('E', 15, RSVD)>, /* LCD_R7 */
|
||||
<STM32_PINMUX('E', 5, RSVD)>, /* LCD_G0 */
|
||||
<STM32_PINMUX('E', 6, RSVD)>, /* LCD_G1 */
|
||||
<STM32_PINMUX('H', 13, RSVD)>, /* LCD_G2 */
|
||||
<STM32_PINMUX('H', 14, RSVD)>, /* LCD_G3 */
|
||||
<STM32_PINMUX('H', 15, RSVD)>, /* LCD_G4 */
|
||||
<STM32_PINMUX('I', 0, RSVD)>, /* LCD_G5 */
|
||||
<STM32_PINMUX('I', 1, RSVD)>, /* LCD_G6 */
|
||||
<STM32_PINMUX('I', 2, RSVD)>, /* LCD_G7 */
|
||||
<STM32_PINMUX('D', 9, RSVD)>, /* LCD_B0 */
|
||||
<STM32_PINMUX('G', 12, RSVD)>, /* LCD_B1 */
|
||||
<STM32_PINMUX('G', 10, RSVD)>, /* LCD_B2 */
|
||||
<STM32_PINMUX('D', 10, RSVD)>, /* LCD_B3 */
|
||||
<STM32_PINMUX('I', 4, RSVD)>, /* LCD_B4 */
|
||||
<STM32_PINMUX('A', 3, RSVD)>, /* LCD_B5 */
|
||||
<STM32_PINMUX('B', 8, RSVD)>, /* LCD_B6 */
|
||||
<STM32_PINMUX('D', 8, RSVD)>; /* LCD_B7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_ltdc_pins_b: m4-ltdc-b-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 14, RSVD)>, /* LCD_CLK */
|
||||
<STM32_PINMUX('I', 12, RSVD)>, /* LCD_HSYNC */
|
||||
<STM32_PINMUX('I', 13, RSVD)>, /* LCD_VSYNC */
|
||||
<STM32_PINMUX('K', 7, RSVD)>, /* LCD_DE */
|
||||
<STM32_PINMUX('I', 15, RSVD)>, /* LCD_R0 */
|
||||
<STM32_PINMUX('J', 0, RSVD)>, /* LCD_R1 */
|
||||
<STM32_PINMUX('J', 1, RSVD)>, /* LCD_R2 */
|
||||
<STM32_PINMUX('J', 2, RSVD)>, /* LCD_R3 */
|
||||
<STM32_PINMUX('J', 3, RSVD)>, /* LCD_R4 */
|
||||
<STM32_PINMUX('J', 4, RSVD)>, /* LCD_R5 */
|
||||
<STM32_PINMUX('J', 5, RSVD)>, /* LCD_R6 */
|
||||
<STM32_PINMUX('J', 6, RSVD)>, /* LCD_R7 */
|
||||
<STM32_PINMUX('J', 7, RSVD)>, /* LCD_G0 */
|
||||
<STM32_PINMUX('J', 8, RSVD)>, /* LCD_G1 */
|
||||
<STM32_PINMUX('J', 9, RSVD)>, /* LCD_G2 */
|
||||
<STM32_PINMUX('J', 10, RSVD)>, /* LCD_G3 */
|
||||
<STM32_PINMUX('J', 11, RSVD)>, /* LCD_G4 */
|
||||
<STM32_PINMUX('K', 0, RSVD)>, /* LCD_G5 */
|
||||
<STM32_PINMUX('K', 1, RSVD)>, /* LCD_G6 */
|
||||
<STM32_PINMUX('K', 2, RSVD)>, /* LCD_G7 */
|
||||
<STM32_PINMUX('J', 12, RSVD)>, /* LCD_B0 */
|
||||
<STM32_PINMUX('J', 13, RSVD)>, /* LCD_B1 */
|
||||
<STM32_PINMUX('J', 14, RSVD)>, /* LCD_B2 */
|
||||
<STM32_PINMUX('J', 15, RSVD)>, /* LCD_B3 */
|
||||
<STM32_PINMUX('K', 3, RSVD)>, /* LCD_B4 */
|
||||
<STM32_PINMUX('K', 4, RSVD)>, /* LCD_B5 */
|
||||
<STM32_PINMUX('K', 5, RSVD)>, /* LCD_B6 */
|
||||
<STM32_PINMUX('K', 6, RSVD)>; /* LCD_B7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_m_can1_pins_a: m4-m-can1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 13, RSVD)>, /* CAN1_TX */
|
||||
<STM32_PINMUX('I', 9, RSVD)>; /* CAN1_RX */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm1_pins_a: m4-pwm1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 9, RSVD)>, /* TIM1_CH1 */
|
||||
<STM32_PINMUX('E', 11, RSVD)>, /* TIM1_CH2 */
|
||||
<STM32_PINMUX('E', 14, RSVD)>; /* TIM1_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm2_pins_a: m4-pwm2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 3, RSVD)>; /* TIM2_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm3_pins_a: m4-pwm3-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 7, RSVD)>; /* TIM3_CH2 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm4_pins_a: m4-pwm4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 14, RSVD)>, /* TIM4_CH3 */
|
||||
<STM32_PINMUX('D', 15, RSVD)>; /* TIM4_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm4_pins_b: m4-pwm4-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 13, RSVD)>; /* TIM4_CH2 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm5_pins_a: m4-pwm5-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 11, RSVD)>; /* TIM5_CH2 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm8_pins_a: m4-pwm8-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 2, RSVD)>; /* TIM8_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm12_pins_a: m4-pwm12-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 6, RSVD)>; /* TIM12_CH1 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_qspi_bk1_pins_a: m4-qspi-bk1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 8, RSVD)>, /* QSPI_BK1_IO0 */
|
||||
<STM32_PINMUX('F', 9, RSVD)>, /* QSPI_BK1_IO1 */
|
||||
<STM32_PINMUX('F', 7, RSVD)>, /* QSPI_BK1_IO2 */
|
||||
<STM32_PINMUX('F', 6, RSVD)>, /* QSPI_BK1_IO3 */
|
||||
<STM32_PINMUX('B', 6, RSVD)>; /* QSPI_BK1_NCS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_qspi_bk2_pins_a: m4-qspi-bk2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 2, RSVD)>, /* QSPI_BK2_IO0 */
|
||||
<STM32_PINMUX('H', 3, RSVD)>, /* QSPI_BK2_IO1 */
|
||||
<STM32_PINMUX('G', 10, RSVD)>, /* QSPI_BK2_IO2 */
|
||||
<STM32_PINMUX('G', 7, RSVD)>, /* QSPI_BK2_IO3 */
|
||||
<STM32_PINMUX('C', 0, RSVD)>; /* QSPI_BK2_NCS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_qspi_clk_pins_a: m4-qspi-clk-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 10, RSVD)>; /* QSPI_CLK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_rtc_out2_rmp_pins_a: m4-rtc-out2-rmp-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 8, RSVD)>; /* RTC_OUT2_RMP */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai2a_pins_a: m4-sai2a-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 5, RSVD)>, /* SAI2_SCK_A */
|
||||
<STM32_PINMUX('I', 6, RSVD)>, /* SAI2_SD_A */
|
||||
<STM32_PINMUX('I', 7, RSVD)>, /* SAI2_FS_A */
|
||||
<STM32_PINMUX('E', 0, RSVD)>; /* SAI2_MCLK_A */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai2b_pins_a: m4-sai2b-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 12, RSVD)>, /* SAI2_SCK_B */
|
||||
<STM32_PINMUX('E', 13, RSVD)>, /* SAI2_FS_B */
|
||||
<STM32_PINMUX('E', 14, RSVD)>, /* SAI2_MCLK_B */
|
||||
<STM32_PINMUX('F', 11, RSVD)>; /* SAI2_SD_B */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai2b_pins_b: m4-sai2b-2 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 11, RSVD)>; /* SAI2_SD_B */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai4a_pins_a: m4-sai4a-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 5, RSVD)>; /* SAI4_SD_A */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc1_b4_pins_a: m4-sdmmc1-b4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 8, RSVD)>, /* SDMMC1_D0 */
|
||||
<STM32_PINMUX('C', 9, RSVD)>, /* SDMMC1_D1 */
|
||||
<STM32_PINMUX('C', 10, RSVD)>, /* SDMMC1_D2 */
|
||||
<STM32_PINMUX('C', 11, RSVD)>, /* SDMMC1_D3 */
|
||||
<STM32_PINMUX('D', 2, RSVD)>, /* SDMMC1_CMD */
|
||||
<STM32_PINMUX('C', 12, RSVD)>; /* SDMMC1_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc1_dir_pins_a: m4-sdmmc1-dir-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 2, RSVD)>, /* SDMMC1_D0DIR */
|
||||
<STM32_PINMUX('C', 7, RSVD)>, /* SDMMC1_D123DIR */
|
||||
<STM32_PINMUX('B', 9, RSVD)>, /* SDMMC1_CDIR */
|
||||
<STM32_PINMUX('E', 4, RSVD)>; /* SDMMC1_CKIN */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc2_b4_pins_a: m4-sdmmc2-b4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 14, RSVD)>, /* SDMMC2_D0 */
|
||||
<STM32_PINMUX('B', 15, RSVD)>, /* SDMMC2_D1 */
|
||||
<STM32_PINMUX('B', 3, RSVD)>, /* SDMMC2_D2 */
|
||||
<STM32_PINMUX('B', 4, RSVD)>, /* SDMMC2_D3 */
|
||||
<STM32_PINMUX('G', 6, RSVD)>, /* SDMMC2_CMD */
|
||||
<STM32_PINMUX('E', 3, RSVD)>; /* SDMMC2_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc2_b4_pins_b: m4-sdmmc2-b4-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 14, RSVD)>, /* SDMMC2_D0 */
|
||||
<STM32_PINMUX('B', 15, RSVD)>, /* SDMMC2_D1 */
|
||||
<STM32_PINMUX('B', 3, RSVD)>, /* SDMMC2_D2 */
|
||||
<STM32_PINMUX('B', 4, RSVD)>, /* SDMMC2_D3 */
|
||||
<STM32_PINMUX('G', 6, RSVD)>, /* SDMMC2_CMD */
|
||||
<STM32_PINMUX('E', 3, RSVD)>; /* SDMMC2_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc2_d47_pins_a: m4-sdmmc2-d47-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 8, RSVD)>, /* SDMMC2_D4 */
|
||||
<STM32_PINMUX('A', 9, RSVD)>, /* SDMMC2_D5 */
|
||||
<STM32_PINMUX('E', 5, RSVD)>, /* SDMMC2_D6 */
|
||||
<STM32_PINMUX('D', 3, RSVD)>; /* SDMMC2_D7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc3_b4_pins_a: m4-sdmmc3-b4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 0, RSVD)>, /* SDMMC3_D0 */
|
||||
<STM32_PINMUX('F', 4, RSVD)>, /* SDMMC3_D1 */
|
||||
<STM32_PINMUX('F', 5, RSVD)>, /* SDMMC3_D2 */
|
||||
<STM32_PINMUX('D', 7, RSVD)>, /* SDMMC3_D3 */
|
||||
<STM32_PINMUX('F', 1, RSVD)>, /* SDMMC3_CMD */
|
||||
<STM32_PINMUX('G', 15, RSVD)>; /* SDMMC3_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spdifrx_pins_a: m4-spdifrx-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 12, RSVD)>; /* SPDIF_IN1 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spi4_pins_a: m4-spi4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 12, RSVD)>, /* SPI4_SCK */
|
||||
<STM32_PINMUX('E', 14, RSVD)>, /* SPI4_MOSI */
|
||||
<STM32_PINMUX('E', 13, RSVD)>; /* SPI4_MISO */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spi5_pins_a: m4-spi5-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 7, RSVD)>, /* SPI5_SCK */
|
||||
<STM32_PINMUX('F', 9, RSVD)>, /* SPI5_MOSI */
|
||||
<STM32_PINMUX('F', 8, RSVD)>; /* SPI5_MISO */
|
||||
};
|
||||
};
|
||||
|
||||
m4_stusb1600_pins_a: m4-stusb1600-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 11, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_uart4_pins_a: m4-uart4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 11, RSVD)>, /* UART4_TX */
|
||||
<STM32_PINMUX('B', 2, RSVD)>; /* UART4_RX */
|
||||
};
|
||||
};
|
||||
|
||||
m4_uart7_pins_a: m4-uart7-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 8, RSVD)>, /* USART7_TX */
|
||||
<STM32_PINMUX('E', 7, RSVD)>; /* USART7_RX */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usart2_pins_a: m4-usart2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 5, RSVD)>, /* USART2_TX */
|
||||
<STM32_PINMUX('D', 4, RSVD)>, /* USART2_RTS */
|
||||
<STM32_PINMUX('D', 6, RSVD)>, /* USART2_RX */
|
||||
<STM32_PINMUX('D', 3, RSVD)>; /* USART2_CTS_NSS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usart3_pins_a: m4-usart3-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 10, RSVD)>, /* USART3_TX */
|
||||
<STM32_PINMUX('G', 8, RSVD)>, /* USART3_RTS */
|
||||
<STM32_PINMUX('B', 12, RSVD)>, /* USART3_RX */
|
||||
<STM32_PINMUX('I', 10, RSVD)>; /* USART3_CTS_NSS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usart3_pins_b: m4-usart3-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 10, RSVD)>, /* USART3_TX */
|
||||
<STM32_PINMUX('G', 8, RSVD)>, /* USART3_RTS */
|
||||
<STM32_PINMUX('B', 12, RSVD)>, /* USART3_RX */
|
||||
<STM32_PINMUX('B', 13, RSVD)>; /* USART3_CTS_NSS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usbotg_hs_pins_a: m4-usbotg_hs-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 10, RSVD)>; /* OTG_ID */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usbotg_fs_dp_dm_pins_a: m4-usbotg-fs-dp-dm-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 11, RSVD)>, /* OTG_FS_DM */
|
||||
<STM32_PINMUX('A', 12, RSVD)>; /* OTG_FS_DP */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_z {
|
||||
m4_i2c4_pins_a: m4-i2c4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('Z', 4, AF6)>, /* I2C4_SCL */
|
||||
<STM32_PINMUX('Z', 5, AF6)>; /* I2C4_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spi1_pins_a: m4-spi1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('Z', 0, AF5)>, /* SPI1_SCK */
|
||||
<STM32_PINMUX('Z', 2, AF5)>, /* SPI1_MOSI */
|
||||
<STM32_PINMUX('Z', 1, AF5)>; /* SPI1_MISO */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&m4_rproc {
|
||||
m4_system_resources {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
m4_timers2: timer@40000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40000000>;
|
||||
clocks = <&rcc TIM2_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers3: timer@40001000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40001000>;
|
||||
clocks = <&rcc TIM3_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers4: timer@40002000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40002000>;
|
||||
clocks = <&rcc TIM4_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers5: timer@40003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40003000>;
|
||||
clocks = <&rcc TIM5_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers6: timer@40004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40004000>;
|
||||
clocks = <&rcc TIM6_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers7: timer@40005000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40005000>;
|
||||
clocks = <&rcc TIM7_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers12: timer@40006000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40006000>;
|
||||
clocks = <&rcc TIM12_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers13: timer@40007000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40007000>;
|
||||
clocks = <&rcc TIM13_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers14: timer@40008000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40008000>;
|
||||
clocks = <&rcc TIM14_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer1: timer@40009000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40009000>;
|
||||
clocks = <&rcc LPTIM1_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi2: spi@4000b000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000b000>;
|
||||
clocks = <&rcc SPI2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2s2: audio-controller@4000b000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000b000>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi3: spi@4000c000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000c000>;
|
||||
clocks = <&rcc SPI3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2s3: audio-controller@4000c000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000c000>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spdifrx: audio-controller@4000d000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000d000>;
|
||||
clocks = <&rcc SPDIF_K>;
|
||||
clock-names = "kclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usart2: serial@4000e000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000e000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <27 1>;
|
||||
clocks = <&rcc USART2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usart3: serial@4000f000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000f000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <28 1>;
|
||||
clocks = <&rcc USART3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart4: serial@40010000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40010000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <30 1>;
|
||||
clocks = <&rcc UART4_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart5: serial@40011000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40011000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <31 1>;
|
||||
clocks = <&rcc UART5_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c1: i2c@40012000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40012000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <21 1>;
|
||||
clocks = <&rcc I2C1_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c2: i2c@40013000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40013000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <22 1>;
|
||||
clocks = <&rcc I2C2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c3: i2c@40014000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40014000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <23 1>;
|
||||
clocks = <&rcc I2C3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c5: i2c@40015000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40015000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <25 1>;
|
||||
clocks = <&rcc I2C5_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_cec: cec@40016000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40016000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <69 1>;
|
||||
clocks = <&rcc CEC_K>, <&rcc CK_LSE>;
|
||||
clock-names = "cec", "hdmi-cec";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dac: dac@40017000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40017000>;
|
||||
clocks = <&rcc DAC12>;
|
||||
clock-names = "pclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart7: serial@40018000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40018000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <32 1>;
|
||||
clocks = <&rcc UART7_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart8: serial@40019000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40019000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <33 1>;
|
||||
clocks = <&rcc UART8_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers1: timer@44000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44000000>;
|
||||
clocks = <&rcc TIM1_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers8: timer@44001000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44001000>;
|
||||
clocks = <&rcc TIM8_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usart6: serial@44003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44003000>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <29 1>;
|
||||
clocks = <&rcc USART6_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi1: spi@44004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44004000>;
|
||||
clocks = <&rcc SPI1_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2s1: audio-controller@44004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44004000>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi4: spi@44005000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44005000>;
|
||||
clocks = <&rcc SPI4_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers15: timer@44006000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44006000>;
|
||||
clocks = <&rcc TIM15_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers16: timer@44007000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44007000>;
|
||||
clocks = <&rcc TIM16_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers17: timer@44008000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44008000>;
|
||||
clocks = <&rcc TIM17_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi5: spi@44009000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44009000>;
|
||||
clocks = <&rcc SPI5_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai1: sai@4400a000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400a000>;
|
||||
clocks = <&rcc SAI1_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai2: sai@4400b000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400b000>;
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai3: sai@4400c000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400c000>;
|
||||
clocks = <&rcc SAI3_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dfsdm: dfsdm@4400d000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400d000>;
|
||||
clocks = <&rcc DFSDM_K>;
|
||||
clock-names = "dfsdm";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_m_can1: can@4400e000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400e000>, <0x44011000>;
|
||||
clocks = <&rcc FDCAN>, <&rcc FDCAN_K>;
|
||||
clock-names = "hclk", "cclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_m_can2: can@4400f000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400f000>, <0x44011000>;
|
||||
clocks = <&rcc FDCAN>, <&rcc FDCAN_K>;
|
||||
clock-names = "hclk", "cclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dma1: dma@48000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48000000>;
|
||||
clocks = <&rcc DMA1>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dma2: dma@48001000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48001000>;
|
||||
clocks = <&rcc DMA2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dmamux1: dma-router@48002000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48002000>;
|
||||
clocks = <&rcc DMAMUX>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_adc: adc@48003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48003000>;
|
||||
clocks = <&rcc ADC12>, <&rcc ADC12_K>;
|
||||
clock-names = "bus", "adc";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sdmmc3: sdmmc@48004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48004000>, <0x48005000>;
|
||||
clocks = <&rcc SDMMC3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usbotg_hs: usb-otg@49000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x49000000>;
|
||||
clocks = <&rcc USBO_K>;
|
||||
clock-names = "otg";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_hash2: hash@4c002000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c002000>;
|
||||
clocks = <&rcc HASH2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_rng2: rng@4c003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c003000>;
|
||||
clocks = <&rcc RNG2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_crc2: crc@4c004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c004000>;
|
||||
clocks = <&rcc CRC2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_cryp2: cryp@4c005000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c005000>;
|
||||
clocks = <&rcc CRYP2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dcmi: dcmi@4c006000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c006000>;
|
||||
clocks = <&rcc DCMI>;
|
||||
clock-names = "mclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer2: timer@50021000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50021000>;
|
||||
clocks = <&rcc LPTIM2_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer3: timer@50022000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50022000>;
|
||||
clocks = <&rcc LPTIM3_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer4: timer@50023000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50023000>;
|
||||
clocks = <&rcc LPTIM4_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer5: timer@50024000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50024000>;
|
||||
clocks = <&rcc LPTIM5_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai4: sai@50027000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50027000>;
|
||||
clocks = <&rcc SAI4_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_qspi: qspi@58003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x58003000>, <0x70000000>;
|
||||
clocks = <&rcc QSPI_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_ethernet0: ethernet@5800a000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x5800a000>;
|
||||
clock-names = "stmmaceth",
|
||||
"mac-clk-tx",
|
||||
"mac-clk-rx",
|
||||
"ethstp",
|
||||
"syscfg-clk";
|
||||
clocks = <&rcc ETHMAC>,
|
||||
<&rcc ETHTX>,
|
||||
<&rcc ETHRX>,
|
||||
<&rcc ETHSTP>,
|
||||
<&rcc SYSCFG>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
90
arch/arm/dts/stm32mp157caa-pinctrl.dtsi
Normal file
90
arch/arm/dts/stm32mp157caa-pinctrl.dtsi
Normal file
@ -0,0 +1,90 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2018 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP157CAA>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 80 16>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 96 16>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 112 16>;
|
||||
};
|
||||
|
||||
gpioi: gpio@5000a000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 128 16>;
|
||||
};
|
||||
|
||||
gpioj: gpio@5000b000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 144 16>;
|
||||
};
|
||||
|
||||
gpiok: gpio@5000c000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl 0 160 8>;
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl_z: pin-controller-z@54004000 {
|
||||
st,package = <STM32MP157CAA>;
|
||||
|
||||
gpioz: gpio@54004000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl_z 0 400 8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
62
arch/arm/dts/stm32mp157cab-pinctrl.dtsi
Normal file
62
arch/arm/dts/stm32mp157cab-pinctrl.dtsi
Normal file
@ -0,0 +1,62 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2018 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP157CAB>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <6>;
|
||||
gpio-ranges = <&pinctrl 6 86 6>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <10>;
|
||||
gpio-ranges = <&pinctrl 6 102 10>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <2>;
|
||||
gpio-ranges = <&pinctrl 0 112 2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
78
arch/arm/dts/stm32mp157cac-pinctrl.dtsi
Normal file
78
arch/arm/dts/stm32mp157cac-pinctrl.dtsi
Normal file
@ -0,0 +1,78 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2018 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP157CAC>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 80 16>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 96 16>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 112 16>;
|
||||
};
|
||||
|
||||
gpioi: gpio@5000a000 {
|
||||
status = "okay";
|
||||
ngpios = <12>;
|
||||
gpio-ranges = <&pinctrl 0 128 12>;
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl_z: pin-controller-z@54004000 {
|
||||
st,package = <STM32MP157CAC>;
|
||||
|
||||
gpioz: gpio@54004000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl_z 0 400 8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
62
arch/arm/dts/stm32mp157cad-pinctrl.dtsi
Normal file
62
arch/arm/dts/stm32mp157cad-pinctrl.dtsi
Normal file
@ -0,0 +1,62 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2018 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP157CAD>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <6>;
|
||||
gpio-ranges = <&pinctrl 6 86 6>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <10>;
|
||||
gpio-ranges = <&pinctrl 6 102 10>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <2>;
|
||||
gpio-ranges = <&pinctrl 0 112 2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -7,6 +7,8 @@
|
||||
#ifndef _GPIO_H_
|
||||
#define _GPIO_H_
|
||||
|
||||
#define STM32_GPIOS_PER_BANK 16
|
||||
|
||||
enum stm32_gpio_port {
|
||||
STM32_GPIO_PORT_A = 0,
|
||||
STM32_GPIO_PORT_B,
|
||||
@ -109,6 +111,9 @@ struct stm32_gpio_regs {
|
||||
|
||||
struct stm32_gpio_priv {
|
||||
struct stm32_gpio_regs *regs;
|
||||
unsigned int gpio_range;
|
||||
};
|
||||
|
||||
int stm32_offset_to_index(struct udevice *dev, unsigned int offset);
|
||||
|
||||
#endif /* _GPIO_H_ */
|
||||
|
||||
@ -16,8 +16,12 @@ config SPL
|
||||
select SPL_REGMAP
|
||||
select SPL_DM_RESET
|
||||
select SPL_SERIAL_SUPPORT
|
||||
select SPL_SPI_LOAD
|
||||
select SPL_SYSCON
|
||||
select SPL_DRIVERS_MISC_SUPPORT
|
||||
select SPL_WATCHDOG_SUPPORT
|
||||
imply BOOTSTAGE_STASH if SPL_BOOTSTAGE
|
||||
imply SPL_BOOTSTAGE
|
||||
imply SPL_DISPLAY_PRINT
|
||||
imply SPL_LIBDISK_SUPPORT
|
||||
|
||||
config SYS_SOC
|
||||
@ -25,18 +29,99 @@ config SYS_SOC
|
||||
|
||||
config TARGET_STM32MP1
|
||||
bool "Support stm32mp1xx"
|
||||
select ARCH_SUPPORT_PSCI
|
||||
select ARCH_SUPPORT_PSCI if !STM32MP1_TRUSTED
|
||||
select CPU_V7A
|
||||
select CPU_V7_HAS_NONSEC
|
||||
select CPU_V7_HAS_NONSEC if !STM32MP1_TRUSTED
|
||||
select CPU_V7_HAS_VIRT
|
||||
select OF_BOARD_SETUP
|
||||
select PINCTRL_STM32
|
||||
select STM32_RCC
|
||||
select STM32_RESET
|
||||
select SYS_ARCH_TIMER
|
||||
select SYSRESET_SYSCON
|
||||
select STM32_SERIAL
|
||||
imply BOOTCOUNT_LIMIT
|
||||
imply PRE_CONSOLE_BUFFER
|
||||
imply SILENT_CONSOLE
|
||||
imply SYSRESET_PSCI if STM32MP1_TRUSTED
|
||||
imply SYSRESET_SYSCON if !STM32MP1_TRUSTED
|
||||
help
|
||||
target STMicroelectronics SOC STM32MP1 family
|
||||
STM32MP157, STM32MP153 or STM32MP151
|
||||
STMicroelectronics MPU with core ARMv7
|
||||
dual core A7 for STM32MP157/3, monocore for STM32MP151
|
||||
|
||||
config STM32MP1_RESET_HALT_WORKAROUND
|
||||
bool "workaround for reset halt debug on stm32mp15x"
|
||||
depends on TARGET_STM32MP1
|
||||
default y
|
||||
help
|
||||
Activate a workaround for current STM32MP15x revision B
|
||||
limitation on debug reset halt not handle by ROM code:
|
||||
add a delay loop early in the SPL boot process to wait for
|
||||
the debugger to attach
|
||||
it can be removed when using the Soc revision
|
||||
that fixes the limitation.
|
||||
|
||||
config STM32MP1_TRUSTED
|
||||
bool "Support trusted boot with TF-A"
|
||||
default y if !SPL
|
||||
select ARM_SMCCC
|
||||
help
|
||||
Say Y here to enable boot with TF-A
|
||||
Trusted boot chain is :
|
||||
BootRom => TF-A.stm32 (clock & DDR) => U-Boot.stm32
|
||||
TF-A monitor provides proprietary smc to manage secure devices
|
||||
|
||||
config STM32MP1_OPTEE
|
||||
bool "Support trusted boot with TF-A and OPTEE"
|
||||
depends on STM32MP1_TRUSTED
|
||||
default n
|
||||
help
|
||||
Say Y here to enable boot with TF-A and OPTEE
|
||||
Trusted boot chain is :
|
||||
BootRom => TF-A.stm32 (clock & DDR) => OPTEE => U-Boot.stm32
|
||||
OPTEE monitor provide ST smc to manage secure devices
|
||||
|
||||
config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
|
||||
hex "Partition to use for MMC2 to load U-Boot from"
|
||||
depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION && TARGET_STM32MP1
|
||||
default 1
|
||||
help
|
||||
Partition on the MMC2 to load U-Boot from when the MMC2 is being
|
||||
used in raw mode
|
||||
|
||||
config STM32_ETZPC
|
||||
bool "STM32 Extended TrustZone Protection"
|
||||
depends on TARGET_STM32MP1
|
||||
default y
|
||||
help
|
||||
Say y to enable STM32 Extended TrustZone Protection
|
||||
Controller (ETZPC)
|
||||
|
||||
config CMD_STM32PROG
|
||||
bool "command stm32prog for STM32CudeProgrammer"
|
||||
default y
|
||||
depends on CMD_DFU
|
||||
imply CMD_GPT if MMC
|
||||
imply DFU_MMC if MMC
|
||||
imply DFU_NAND if NAND
|
||||
select DFU_RAM
|
||||
imply DFU_SF if DM_SPI_FLASH
|
||||
select DFU_VIRT
|
||||
select PARTITION_TYPE_GUID
|
||||
help
|
||||
activate a specific command stm32prog for STM32MP soc family
|
||||
witch update the device with the tools STM32CubeProgrammer,
|
||||
using UART with STM32 protocol or USB with DFU protocol
|
||||
NB: access to not volatile memory (NOR/NAND/SD/eMMC) is based
|
||||
on U-Boot DFU framework
|
||||
|
||||
config CMD_STM32KEY
|
||||
bool "command stm32key to fuse public key hash"
|
||||
default y
|
||||
depends on CMD_FUSE
|
||||
help
|
||||
fuse public key hash in corresponding fuse used to authenticate
|
||||
binary.
|
||||
|
||||
config SYS_TEXT_BASE
|
||||
prompt "U-Boot base address"
|
||||
@ -46,17 +131,27 @@ config SYS_TEXT_BASE
|
||||
when DDR driver is used:
|
||||
DDR + 1MB (0xC0100000)
|
||||
|
||||
config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
|
||||
hex "Partition on MMC2 to use to load U-Boot from"
|
||||
depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
|
||||
config PRE_CON_BUF_ADDR
|
||||
default 0xC02FF000
|
||||
|
||||
config PRE_CON_BUF_SZ
|
||||
default 4096
|
||||
|
||||
config NR_DRAM_BANKS
|
||||
default 1
|
||||
help
|
||||
Partition on the second MMC to load U-Boot from when the MMC is being
|
||||
used in raw mode
|
||||
|
||||
source "board/st/stm32mp1/Kconfig"
|
||||
config BOOTSTAGE_STASH_ADDR
|
||||
default 0xC3000000
|
||||
|
||||
if BOOTCOUNT_LIMIT
|
||||
config SYS_BOOTCOUNT_SINGLEWORD
|
||||
default y
|
||||
|
||||
# TAMP_BOOTCOUNT = TAMP_BACKUP_REGISTER(21)
|
||||
config SYS_BOOTCOUNT_ADDR
|
||||
default 0x5C00A154
|
||||
endif
|
||||
|
||||
# currently activated for debug / should be deactivated for real product
|
||||
if DEBUG_UART
|
||||
|
||||
config DEBUG_UART_BOARD_INIT
|
||||
@ -71,4 +166,6 @@ config DEBUG_UART_CLOCK
|
||||
default 64000000
|
||||
endif
|
||||
|
||||
source "board/st/stm32mp1/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
@ -6,11 +6,17 @@
|
||||
obj-y += cpu.o
|
||||
obj-y += dram_init.o
|
||||
obj-y += syscon.o
|
||||
obj-y += bsec.o
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-y += spl.o
|
||||
obj-$(CONFIG_STM32MP1_RESET_HALT_WORKAROUND) += stm32mp1_helper_dbg.o
|
||||
else
|
||||
obj-y += bsec.o
|
||||
endif
|
||||
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog/
|
||||
obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
|
||||
obj-$(CONFIG_SYSRESET) += cmd_poweroff.o
|
||||
obj-$(CONFIG_ARMV7_PSCI) += psci.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_$(SPL_)DM_REGULATOR) += pwr_regulator.o
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += fdt.o
|
||||
|
||||
@ -7,10 +7,14 @@
|
||||
#include <dm.h>
|
||||
#include <misc.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/stm32mp1_smc.h>
|
||||
#include <linux/arm-smccc.h>
|
||||
#include <linux/iopoll.h>
|
||||
|
||||
#define BSEC_OTP_MAX_VALUE 95
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
|
||||
#define BSEC_TIMEOUT_US 10000
|
||||
|
||||
/* BSEC REGISTER OFFSET (base relative) */
|
||||
@ -168,7 +172,7 @@ static int bsec_shadow_register(u32 base, u32 otp)
|
||||
ret = bsec_power_safmem(base, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
power_up = 1;
|
||||
power_up = true;
|
||||
}
|
||||
/* set BSEC_OTP_CTRL_OFF with the otp value*/
|
||||
writel(otp | BSEC_READ, base + BSEC_OTP_CTRL_OFF);
|
||||
@ -270,6 +274,7 @@ static int bsec_program_otp(long base, u32 val, u32 otp)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_STM32MP1_TRUSTED */
|
||||
|
||||
/* BSEC MISC driver *******************************************************/
|
||||
struct stm32mp_bsec_platdata {
|
||||
@ -278,6 +283,11 @@ struct stm32mp_bsec_platdata {
|
||||
|
||||
static int stm32mp_bsec_read_otp(struct udevice *dev, u32 *val, u32 otp)
|
||||
{
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
return stm32_smc(STM32_SMC_BSEC,
|
||||
STM32_SMC_READ_OTP,
|
||||
otp, 0, val);
|
||||
#else
|
||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||
u32 tmp_data = 0;
|
||||
int ret;
|
||||
@ -299,27 +309,46 @@ static int stm32mp_bsec_read_otp(struct udevice *dev, u32 *val, u32 otp)
|
||||
/* restore shadow value */
|
||||
ret = bsec_write_shadow(plat->base, tmp_data, otp);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_read_shadow(struct udevice *dev, u32 *val, u32 otp)
|
||||
{
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
return stm32_smc(STM32_SMC_BSEC,
|
||||
STM32_SMC_READ_SHADOW,
|
||||
otp, 0, val);
|
||||
#else
|
||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||
|
||||
return bsec_read_shadow(plat->base, val, otp);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_write_otp(struct udevice *dev, u32 val, u32 otp)
|
||||
{
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
return stm32_smc_exec(STM32_SMC_BSEC,
|
||||
STM32_SMC_PROG_OTP,
|
||||
otp, val);
|
||||
#else
|
||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||
|
||||
return bsec_program_otp(plat->base, val, otp);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_write_shadow(struct udevice *dev, u32 val, u32 otp)
|
||||
{
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
return stm32_smc_exec(STM32_SMC_BSEC,
|
||||
STM32_SMC_WRITE_SHADOW,
|
||||
otp, val);
|
||||
#else
|
||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||
|
||||
return bsec_write_shadow(plat->base, val, otp);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_read(struct udevice *dev, int offset,
|
||||
@ -330,12 +359,13 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
|
||||
bool shadow = true;
|
||||
int nb_otp = size / sizeof(u32);
|
||||
int otp;
|
||||
unsigned int offs = offset;
|
||||
|
||||
if (offset >= STM32_BSEC_OTP_OFFSET) {
|
||||
offset -= STM32_BSEC_OTP_OFFSET;
|
||||
if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
offs -= STM32_BSEC_OTP_OFFSET;
|
||||
shadow = false;
|
||||
}
|
||||
otp = offset / sizeof(u32);
|
||||
otp = offs / sizeof(u32);
|
||||
|
||||
if (otp < 0 || (otp + nb_otp - 1) > BSEC_OTP_MAX_VALUE) {
|
||||
dev_err(dev, "wrong value for otp, max value : %i\n",
|
||||
@ -365,12 +395,13 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
|
||||
bool shadow = true;
|
||||
int nb_otp = size / sizeof(u32);
|
||||
int otp;
|
||||
unsigned int offs = offset;
|
||||
|
||||
if (offset >= STM32_BSEC_OTP_OFFSET) {
|
||||
offset -= STM32_BSEC_OTP_OFFSET;
|
||||
if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
offs -= STM32_BSEC_OTP_OFFSET;
|
||||
shadow = false;
|
||||
}
|
||||
otp = offset / sizeof(u32);
|
||||
otp = offs / sizeof(u32);
|
||||
|
||||
if (otp < 0 || (otp + nb_otp - 1) > BSEC_OTP_MAX_VALUE) {
|
||||
dev_err(dev, "wrong value for otp, max value : %d\n",
|
||||
@ -405,8 +436,23 @@ static int stm32mp_bsec_ofdata_to_platdata(struct udevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_STM32MP1_TRUSTED) && !defined(CONFIG_SPL_BUILD)
|
||||
static int stm32mp_bsec_probe(struct udevice *dev)
|
||||
{
|
||||
int otp;
|
||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||
|
||||
/* update unlocked shadow for OTP cleared by the rom code */
|
||||
for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
|
||||
if (!bsec_read_SR_lock(plat->base, otp))
|
||||
bsec_shadow_register(plat->base, otp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct udevice_id stm32mp_bsec_ids[] = {
|
||||
{ .compatible = "st,stm32mp-bsec" },
|
||||
{ .compatible = "st,stm32mp15-bsec" },
|
||||
{}
|
||||
};
|
||||
|
||||
@ -417,15 +463,7 @@ U_BOOT_DRIVER(stm32mp_bsec) = {
|
||||
.ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata,
|
||||
.platdata_auto_alloc_size = sizeof(struct stm32mp_bsec_platdata),
|
||||
.ops = &stm32mp_bsec_ops,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
/* bsec IP is not present in device tee, manage IP address by platdata */
|
||||
static struct stm32mp_bsec_platdata stm32_bsec_platdata = {
|
||||
.base = STM32_BSEC_BASE,
|
||||
};
|
||||
|
||||
U_BOOT_DEVICE(stm32mp_bsec) = {
|
||||
.name = "stm32mp_bsec",
|
||||
.platdata = &stm32_bsec_platdata,
|
||||
#if !defined(CONFIG_STM32MP1_TRUSTED) && !defined(CONFIG_SPL_BUILD)
|
||||
.probe = stm32mp_bsec_probe,
|
||||
#endif
|
||||
};
|
||||
|
||||
24
arch/arm/mach-stm32mp/cmd_poweroff.c
Normal file
24
arch/arm/mach-stm32mp/cmd_poweroff.c
Normal file
@ -0,0 +1,24 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <sysreset.h>
|
||||
|
||||
int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
int ret;
|
||||
|
||||
puts("poweroff ...\n");
|
||||
mdelay(100);
|
||||
|
||||
ret = sysreset_walk(SYSRESET_POWER);
|
||||
|
||||
if (ret == -EINPROGRESS)
|
||||
mdelay(1000);
|
||||
|
||||
/*NOTREACHED when power off*/
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
101
arch/arm/mach-stm32mp/cmd_stm32key.c
Normal file
101
arch/arm/mach-stm32mp/cmd_stm32key.c
Normal file
@ -0,0 +1,101 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <console.h>
|
||||
#include <misc.h>
|
||||
#include <dm/device.h>
|
||||
#include <dm/uclass.h>
|
||||
|
||||
#define STM32_OTP_HASH_KEY_START 24
|
||||
#define STM32_OTP_HASH_KEY_SIZE 8
|
||||
|
||||
static void read_hash_value(u32 addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < STM32_OTP_HASH_KEY_SIZE; i++) {
|
||||
printf("OTP value %i: %x\n", STM32_OTP_HASH_KEY_START + i,
|
||||
__be32_to_cpu(*(u32 *)addr));
|
||||
addr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
static void fuse_hash_value(u32 addr, bool print)
|
||||
{
|
||||
struct udevice *dev;
|
||||
u32 word, val;
|
||||
int i, ret;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
if (ret) {
|
||||
pr_err("Can't find stm32mp_bsec driver\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < STM32_OTP_HASH_KEY_SIZE; i++) {
|
||||
if (print)
|
||||
printf("Fuse OTP %i : %x\n",
|
||||
STM32_OTP_HASH_KEY_START + i,
|
||||
__be32_to_cpu(*(u32 *)addr));
|
||||
|
||||
word = STM32_OTP_HASH_KEY_START + i;
|
||||
val = __be32_to_cpu(*(u32 *)addr);
|
||||
misc_write(dev, STM32_BSEC_OTP(word), &val, 4);
|
||||
|
||||
addr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
static int confirm_prog(void)
|
||||
{
|
||||
puts("Warning: Programming fuses is an irreversible operation!\n"
|
||||
" This may brick your system.\n"
|
||||
" Use this command only if you are sure of what you are doing!\n"
|
||||
"\nReally perform this fuse programming? <y/N>\n");
|
||||
|
||||
if (confirm_yesno())
|
||||
return 1;
|
||||
|
||||
puts("Fuse programming aborted\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_stm32key(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
u32 addr;
|
||||
const char *op = argc >= 2 ? argv[1] : NULL;
|
||||
int confirmed = argc > 3 && !strcmp(argv[2], "-y");
|
||||
|
||||
argc -= 2 + confirmed;
|
||||
argv += 2 + confirmed;
|
||||
|
||||
if (argc < 1)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = simple_strtoul(argv[0], NULL, 16);
|
||||
if (!addr)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (!strcmp(op, "read"))
|
||||
read_hash_value(addr);
|
||||
|
||||
if (!strcmp(op, "fuse")) {
|
||||
if (!confirmed && !confirm_prog())
|
||||
return CMD_RET_FAILURE;
|
||||
fuse_hash_value(addr, !confirmed);
|
||||
}
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(stm32key, 4, 1, do_stm32key,
|
||||
"Fuse ST Hash key",
|
||||
"read <addr>: Read the hash store at addr in memory\n"
|
||||
"stm32key fuse [-y] <addr> : Fuse hash store at addr in otp\n");
|
||||
9
arch/arm/mach-stm32mp/cmd_stm32prog/Makefile
Normal file
9
arch/arm/mach-stm32mp/cmd_stm32prog/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
#
|
||||
|
||||
obj-y += cmd_stm32prog.o
|
||||
obj-y += stm32prog.o
|
||||
obj-y += stm32prog_serial.o
|
||||
obj-y += stm32prog_usb.o
|
||||
102
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
Normal file
102
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
Normal file
@ -0,0 +1,102 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <dfu.h>
|
||||
#include "stm32prog.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static void enable_vidconsole(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
char *stdname;
|
||||
char buf[64];
|
||||
|
||||
stdname = env_get("stdout");
|
||||
if (!strstr(stdname, "vidconsole")) {
|
||||
snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
|
||||
env_set("stdout", buf);
|
||||
}
|
||||
|
||||
stdname = env_get("stderr");
|
||||
if (!strstr(stdname, "vidconsole")) {
|
||||
snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
|
||||
env_set("stderr", buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int do_stm32prog(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
struct stm32prog_data *data;
|
||||
ulong addr, size;
|
||||
int dev;
|
||||
enum stm32prog_link_t link = LINK_UNDEFINED;
|
||||
bool reset = false;
|
||||
|
||||
if (argc < 3 || argc > 5)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (!strcmp(argv[1], "serial")) {
|
||||
link = LINK_SERIAL;
|
||||
} else {
|
||||
if (!strcmp(argv[1], "usb")) {
|
||||
link = LINK_USB;
|
||||
} else {
|
||||
pr_err("not supported link=%s\n", argv[1]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
}
|
||||
dev = (int)simple_strtoul(argv[2], NULL, 10);
|
||||
|
||||
addr = STM32_DDR_BASE;
|
||||
size = 0;
|
||||
if (argc > 3) {
|
||||
addr = simple_strtoul(argv[3], NULL, 16);
|
||||
if (!addr)
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
if (argc > 4)
|
||||
size = simple_strtoul(argv[4], NULL, 16);
|
||||
|
||||
enable_vidconsole();
|
||||
|
||||
data = stm32prog_init(link, dev, addr, size);
|
||||
if (!data)
|
||||
return CMD_RET_FAILURE;
|
||||
|
||||
switch (link) {
|
||||
case LINK_SERIAL:
|
||||
reset = stm32prog_serial_loop(data);
|
||||
break;
|
||||
case LINK_USB:
|
||||
reset = stm32prog_usb_loop(data, dev);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
stm32prog_clean(data);
|
||||
|
||||
puts("Download done\n");
|
||||
if (reset) {
|
||||
puts("Reset...\n");
|
||||
run_command("reset", 0);
|
||||
}
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog,
|
||||
"<link> <dev> [<addr>] [<size>]\n"
|
||||
"start communication with tools STM32Cubeprogrammer on <link> with Flashlayout at <addr>",
|
||||
"<link> = serial|usb\n"
|
||||
"<dev> = device instance\n"
|
||||
"<addr> = address of flashlayout\n"
|
||||
"<size> = size of flashlayout\n"
|
||||
);
|
||||
1666
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
Normal file
1666
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
Normal file
File diff suppressed because it is too large
Load Diff
202
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
Normal file
202
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
Normal file
@ -0,0 +1,202 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#ifndef _STM32PROG_H_
|
||||
#define _STM32PROG_H_
|
||||
|
||||
/* - configuration part -----------------------------*/
|
||||
#define USART_BL_VERSION 0x40 /* USART bootloader version V4.0*/
|
||||
#define UBOOT_BL_VERSION 0x03 /* bootloader version V0.3*/
|
||||
#define DEVICE_ID_BYTE1 0x05 /* MSB byte of device ID*/
|
||||
#define DEVICE_ID_BYTE2 0x00 /* LSB byte of device ID*/
|
||||
#define USART_RAM_BUFFER_SIZE 256 /* Size of USART_RAM_Buf buffer*/
|
||||
|
||||
/* - Commands -----------------------------*/
|
||||
#define GET_CMD_COMMAND 0x00 /* Get CMD command*/
|
||||
#define GET_VER_COMMAND 0x01 /* Get Version command*/
|
||||
#define GET_ID_COMMAND 0x02 /* Get ID command*/
|
||||
#define GET_PHASE_COMMAND 0x03 /* Get Phase command*/
|
||||
#define RM_COMMAND 0x11 /* Read Memory command*/
|
||||
#define READ_PART_COMMAND 0x12 /* Read Partition command*/
|
||||
#define START_COMMAND 0x21 /* START command (Go)*/
|
||||
#define DOWNLOAD_COMMAND 0x31 /* Download command*/
|
||||
/* existing command for other STM32 but not used */
|
||||
/* ERASE 0x43 */
|
||||
/* EXTENDED_ERASE 0x44 */
|
||||
/* WRITE_UNPROTECTED 0x73 */
|
||||
/* READOUT_PROTECT 0x82 */
|
||||
/* READOUT_UNPROTECT 0x92 */
|
||||
|
||||
/* - miscellaneous defines ----------------------------------------*/
|
||||
#define INIT_BYTE 0x7F /*Init Byte ID*/
|
||||
#define ACK_BYTE 0x79 /*Acknowlede Byte ID*/
|
||||
#define NACK_BYTE 0x1F /*No Acknowlede Byte ID*/
|
||||
#define ABORT_BYTE 0x5F /*ABORT*/
|
||||
|
||||
/* - phase defines ------------------------------------------------*/
|
||||
#define PHASE_FLASHLAYOUT 0x00
|
||||
#define PHASE_FIRST_USER 0x10
|
||||
#define PHASE_LAST_USER 0xF0
|
||||
#define PHASE_CMD 0xF1
|
||||
#define PHASE_OTP 0xF2
|
||||
#define PHASE_SSP 0xF3
|
||||
#define PHASE_PMIC 0xF4
|
||||
#define PHASE_END 0xFE
|
||||
#define PHASE_RESET 0xFF
|
||||
#define PHASE_DO_RESET 0x1FF
|
||||
|
||||
#define DEFAULT_ADDRESS 0xFFFFFFFF
|
||||
|
||||
#define OTP_SIZE 1024
|
||||
#define PMIC_SIZE 8
|
||||
|
||||
enum stm32prog_link_t {
|
||||
LINK_SERIAL,
|
||||
LINK_USB,
|
||||
LINK_UNDEFINED,
|
||||
};
|
||||
|
||||
struct image_header_s {
|
||||
bool present;
|
||||
u32 image_checksum;
|
||||
u32 image_length;
|
||||
};
|
||||
|
||||
struct raw_header_s {
|
||||
u32 magic_number;
|
||||
u32 image_signature[64 / 4];
|
||||
u32 image_checksum;
|
||||
u32 header_version;
|
||||
u32 image_length;
|
||||
u32 image_entry_point;
|
||||
u32 reserved1;
|
||||
u32 load_address;
|
||||
u32 reserved2;
|
||||
u32 version_number;
|
||||
u32 option_flags;
|
||||
u32 ecdsa_algorithm;
|
||||
u32 ecdsa_public_key[64 / 4];
|
||||
u32 padding[83 / 4];
|
||||
u32 binary_type;
|
||||
};
|
||||
|
||||
#define BL_HEADER_SIZE sizeof(struct raw_header_s)
|
||||
|
||||
/* partition type in flashlayout file */
|
||||
enum stm32prog_part_type {
|
||||
PART_BINARY,
|
||||
PART_SYSTEM,
|
||||
PART_FILESYSTEM,
|
||||
RAW_IMAGE
|
||||
};
|
||||
|
||||
/* device information */
|
||||
struct stm32prog_dev_t {
|
||||
enum dfu_device_type dev_type;
|
||||
char dev_id;
|
||||
struct blk_desc *block_dev;
|
||||
u32 lba_blk_size; /* for MMC RAW */
|
||||
u32 erase_size;
|
||||
struct mtd_info *mtd;
|
||||
/* list of partition for this device / ordered in offset */
|
||||
struct list_head part_list;
|
||||
};
|
||||
|
||||
/* partition information build form FlashLayout and device */
|
||||
struct stm32prog_part_t {
|
||||
/* FlashLayout inforamtion */
|
||||
int option;
|
||||
int id;
|
||||
enum stm32prog_part_type part_type;
|
||||
enum dfu_device_type dev_type;
|
||||
char dev_id;
|
||||
/* partition name
|
||||
* (16 char in gpt, + 1 for null terminated string
|
||||
*/
|
||||
char name[16 + 1];
|
||||
u64 addr;
|
||||
u64 size;
|
||||
enum stm32prog_part_type bin_nb; /* SSBL repeatition */
|
||||
|
||||
/* information on associated device */
|
||||
struct stm32prog_dev_t *dev; /* pointer to device */
|
||||
/* partition id in gpt when >0, -1 and -2 for boot partition of MMC */
|
||||
s16 part_id;
|
||||
int alt_id; /* alt id in usb/dfu */
|
||||
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
#define STM32PROG_MAX_DEV 5
|
||||
struct stm32prog_data {
|
||||
/* Layout information */
|
||||
int dev_nb; /* device number*/
|
||||
struct stm32prog_dev_t dev[STM32PROG_MAX_DEV]; /* array of device */
|
||||
int part_nb; /* nb of partition */
|
||||
struct stm32prog_part_t *part_array; /* array of partition */
|
||||
int full_update;
|
||||
|
||||
/* command internal information */
|
||||
unsigned int phase;
|
||||
u32 offset;
|
||||
char error[255];
|
||||
struct stm32prog_part_t *cur_part;
|
||||
u32 *otp_part;
|
||||
u8 pmic_part[PMIC_SIZE];
|
||||
|
||||
/* STM32 header information */
|
||||
struct raw_header_s *header_data;
|
||||
struct image_header_s header;
|
||||
|
||||
/* SERIAL information */
|
||||
u32 cursor;
|
||||
u32 packet_number;
|
||||
u32 checksum;
|
||||
u8 *buffer; /* size = USART_RAM_BUFFER_SIZE*/
|
||||
int dfu_seq;
|
||||
u8 read_phase;
|
||||
};
|
||||
|
||||
/* OTP access */
|
||||
int stm32prog_otp_write(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_otp_read(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_otp_start(struct stm32prog_data *data);
|
||||
|
||||
/* PMIC access */
|
||||
int stm32prog_pmic_write(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_pmic_read(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_pmic_start(struct stm32prog_data *data);
|
||||
|
||||
/* generic part*/
|
||||
u8 stm32prog_header_check(struct raw_header_s *raw_header,
|
||||
struct image_header_s *header);
|
||||
int stm32prog_dfu_init(struct stm32prog_data *data);
|
||||
void stm32prog_end_phase(struct stm32prog_data *data);
|
||||
void stm32prog_next_phase(struct stm32prog_data *data);
|
||||
void stm32prog_do_reset(struct stm32prog_data *data);
|
||||
|
||||
int stm32prog_serial_init(struct stm32prog_data *data, int link_dev);
|
||||
|
||||
char *stm32prog_get_error(struct stm32prog_data *data);
|
||||
|
||||
#define stm32prog_err(args...) {\
|
||||
if (data->phase != PHASE_RESET) { \
|
||||
sprintf(data->error, args); \
|
||||
data->phase = PHASE_RESET; \
|
||||
pr_err("Error: %s\n", data->error); } \
|
||||
}
|
||||
|
||||
/* Main function */
|
||||
struct stm32prog_data *stm32prog_init(enum stm32prog_link_t link,
|
||||
int dev, ulong addr, ulong size);
|
||||
bool stm32prog_serial_loop(struct stm32prog_data *data);
|
||||
bool stm32prog_usb_loop(struct stm32prog_data *data, int dev);
|
||||
void stm32prog_clean(struct stm32prog_data *data);
|
||||
|
||||
#endif
|
||||
984
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c
Normal file
984
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c
Normal file
@ -0,0 +1,984 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <dfu.h>
|
||||
#include <malloc.h>
|
||||
#include <serial.h>
|
||||
#include <watchdog.h>
|
||||
#include <dm/lists.h>
|
||||
#include <dm/device-internal.h>
|
||||
#include "stm32prog.h"
|
||||
|
||||
struct udevice *down_serial_dev;
|
||||
|
||||
const u8 cmd_id[] = {
|
||||
GET_CMD_COMMAND,
|
||||
GET_VER_COMMAND,
|
||||
GET_ID_COMMAND,
|
||||
GET_PHASE_COMMAND,
|
||||
RM_COMMAND,
|
||||
READ_PART_COMMAND,
|
||||
START_COMMAND,
|
||||
DOWNLOAD_COMMAND
|
||||
};
|
||||
|
||||
#define NB_CMD sizeof(cmd_id)
|
||||
|
||||
/* DFU support for serial *********************************************/
|
||||
static struct dfu_entity *stm32prog_get_entity(struct stm32prog_data *data)
|
||||
{
|
||||
int alt_id;
|
||||
|
||||
if (!data->cur_part)
|
||||
if (data->phase == PHASE_FLASHLAYOUT)
|
||||
alt_id = 0;
|
||||
else
|
||||
return NULL;
|
||||
else
|
||||
alt_id = data->cur_part->alt_id;
|
||||
|
||||
return dfu_get_entity(alt_id);
|
||||
}
|
||||
|
||||
static int stm32prog_write(struct stm32prog_data *data, u8 *buffer,
|
||||
u32 buffer_size)
|
||||
{
|
||||
struct dfu_entity *dfu_entity;
|
||||
u8 ret = 0;
|
||||
|
||||
dfu_entity = stm32prog_get_entity(data);
|
||||
if (!dfu_entity)
|
||||
return -ENODEV;
|
||||
|
||||
ret = dfu_write(dfu_entity,
|
||||
buffer,
|
||||
buffer_size,
|
||||
data->dfu_seq);
|
||||
|
||||
if (ret) {
|
||||
stm32prog_err("DFU write failed [%d] cnt: %d",
|
||||
ret, data->dfu_seq);
|
||||
}
|
||||
data->dfu_seq++;
|
||||
/* handle rollover as in driver/dfu/dfu.c */
|
||||
data->dfu_seq &= 0xffff;
|
||||
if (buffer_size == 0)
|
||||
data->dfu_seq = 0; /* flush done */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int stm32prog_read(struct stm32prog_data *data, u8 phase, u32 offset,
|
||||
u8 *buffer, u32 buffer_size)
|
||||
{
|
||||
struct dfu_entity *dfu_entity;
|
||||
u32 size;
|
||||
int ret;
|
||||
|
||||
/* pr_debug("%s entry\n", __func__); */
|
||||
if (data->dfu_seq) {
|
||||
stm32prog_err("DFU write pending for phase %d, seq %d",
|
||||
data->phase, data->dfu_seq);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (phase == PHASE_FLASHLAYOUT || phase > PHASE_LAST_USER) {
|
||||
stm32prog_err("read failed : phase %d is invalid", phase);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (data->read_phase <= PHASE_LAST_USER &&
|
||||
phase != data->read_phase) {
|
||||
/* clear previous read session */
|
||||
dfu_entity = dfu_get_entity(data->read_phase - 1);
|
||||
if (dfu_entity)
|
||||
dfu_transaction_cleanup(dfu_entity);
|
||||
}
|
||||
dfu_entity = dfu_get_entity(phase - 1);
|
||||
if (!dfu_entity) {
|
||||
stm32prog_err("read failed : phase %d is unknown", phase);
|
||||
return -ENODEV;
|
||||
}
|
||||
/* clear pending read before to force offset */
|
||||
if (dfu_entity->inited &&
|
||||
(data->read_phase != phase || data->offset != offset))
|
||||
dfu_transaction_cleanup(dfu_entity);
|
||||
|
||||
/* initiate before to force offset */
|
||||
if (!dfu_entity->inited) {
|
||||
ret = dfu_transaction_initiate(dfu_entity, true);
|
||||
if (ret < 0) {
|
||||
stm32prog_err("DFU read init failed [%d] phase = %d offset = 0x%08x",
|
||||
ret, phase, offset);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
/* force new offset */
|
||||
if (dfu_entity->offset != offset)
|
||||
dfu_entity->offset = offset;
|
||||
data->offset = offset;
|
||||
data->read_phase = phase;
|
||||
pr_debug("\nSTM32 download read %s offset=0x%x\n",
|
||||
dfu_entity->name, offset);
|
||||
ret = dfu_read(dfu_entity, buffer, buffer_size,
|
||||
dfu_entity->i_blk_seq_num);
|
||||
if (ret < 0) {
|
||||
stm32prog_err("DFU read failed [%d] phase = %d offset = 0x%08x",
|
||||
ret, phase, offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
size = ret;
|
||||
|
||||
if (size < buffer_size) {
|
||||
data->offset = 0;
|
||||
data->read_phase = PHASE_END;
|
||||
memset(buffer + size, 0, buffer_size - size);
|
||||
} else {
|
||||
data->offset += size;
|
||||
}
|
||||
/*pr_debug("%s exit ret=%d\n", __func__, ret);*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* UART access ***************************************************/
|
||||
int stm32prog_serial_init(struct stm32prog_data *data, int link_dev)
|
||||
{
|
||||
struct udevice *dev = NULL;
|
||||
int node;
|
||||
char alias[10];
|
||||
const char *path;
|
||||
struct dm_serial_ops *ops;
|
||||
/* no parity, 8 bits, 1 stop */
|
||||
u32 serial_config = SERIAL_DEFAULT_CONFIG;
|
||||
|
||||
down_serial_dev = NULL;
|
||||
|
||||
sprintf(alias, "serial%d", link_dev);
|
||||
path = fdt_get_alias(gd->fdt_blob, alias);
|
||||
if (!path) {
|
||||
pr_err("%s alias not found", alias);
|
||||
return -ENODEV;
|
||||
}
|
||||
node = fdt_path_offset(gd->fdt_blob, path);
|
||||
if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node,
|
||||
&dev)) {
|
||||
down_serial_dev = dev;
|
||||
} else if (node > 0 &&
|
||||
!lists_bind_fdt(gd->dm_root, offset_to_ofnode(node),
|
||||
&dev)) {
|
||||
if (!device_probe(dev))
|
||||
down_serial_dev = dev;
|
||||
}
|
||||
/*pr_debug("alias=%s, path=%s, node = %d, dev=%0x\n",
|
||||
* alias, path, node, (u32)down_serial_dev);
|
||||
*/
|
||||
if (!down_serial_dev) {
|
||||
pr_err("%s = %s device not found", alias, path);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* force silent console on uart only when used */
|
||||
if (gd->cur_serial_dev == down_serial_dev)
|
||||
gd->flags |= GD_FLG_DISABLE_CONSOLE | GD_FLG_SILENT;
|
||||
else
|
||||
gd->flags &= ~(GD_FLG_DISABLE_CONSOLE | GD_FLG_SILENT);
|
||||
|
||||
ops = serial_get_ops(down_serial_dev);
|
||||
|
||||
if (!ops) {
|
||||
pr_err("%s = %s missing ops", alias, path);
|
||||
return -ENODEV;
|
||||
}
|
||||
if (!ops->setconfig) {
|
||||
pr_err("%s = %s missing setconfig", alias, path);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
clrsetbits_le32(&serial_config, SERIAL_PAR_MASK, SERIAL_PAR_EVEN);
|
||||
|
||||
return ops->setconfig(down_serial_dev, serial_config);
|
||||
}
|
||||
|
||||
static void stm32prog_serial_flush(void)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->getc(down_serial_dev);
|
||||
} while (err != -EAGAIN);
|
||||
}
|
||||
|
||||
static int stm32prog_serial_getc_err(void)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->getc(down_serial_dev);
|
||||
if (err == -EAGAIN) {
|
||||
ctrlc();
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
} while ((err == -EAGAIN) && (!had_ctrlc()));
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static u8 stm32prog_serial_getc(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = stm32prog_serial_getc_err();
|
||||
|
||||
return err >= 0 ? err : 0;
|
||||
}
|
||||
|
||||
static bool stm32prog_serial_get_buffer(u8 *buffer, u32 *count)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->getc(down_serial_dev);
|
||||
if (err >= 0) {
|
||||
*buffer++ = err;
|
||||
*count -= 1;
|
||||
} else if (err == -EAGAIN) {
|
||||
ctrlc();
|
||||
WATCHDOG_RESET();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} while (*count && !had_ctrlc());
|
||||
|
||||
return !!(err < 0);
|
||||
}
|
||||
|
||||
static void stm32prog_serial_putc(u8 w_byte)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->putc(down_serial_dev, w_byte);
|
||||
} while (err == -EAGAIN);
|
||||
}
|
||||
|
||||
/* Helper function ************************************************/
|
||||
|
||||
static u8 stm32prog_header(struct stm32prog_data *data)
|
||||
{
|
||||
u8 ret;
|
||||
u8 boot = 0;
|
||||
struct dfu_entity *dfu_entity;
|
||||
u64 size = 0;
|
||||
|
||||
/*pr_debug("%s entry\n", __func__);*/
|
||||
|
||||
dfu_entity = stm32prog_get_entity(data);
|
||||
if (!dfu_entity)
|
||||
return -ENODEV;
|
||||
|
||||
printf("\nSTM32 download write %s\n", dfu_entity->name);
|
||||
|
||||
/* force cleanup to avoid issue with previous read */
|
||||
dfu_transaction_cleanup(dfu_entity);
|
||||
|
||||
ret = stm32prog_header_check(data->header_data,
|
||||
&data->header);
|
||||
|
||||
/* no header : max size is partition size */
|
||||
if (ret) {
|
||||
dfu_entity->get_medium_size(dfu_entity, &size);
|
||||
data->header.image_length = size;
|
||||
}
|
||||
|
||||
/**** Flash the header if necessary for boot partition */
|
||||
if (data->phase < PHASE_FIRST_USER)
|
||||
boot = 1;
|
||||
|
||||
/* write header if boot partition */
|
||||
if (boot) {
|
||||
if (ret) {
|
||||
stm32prog_err("invalid header (error %d)", ret);
|
||||
} else {
|
||||
ret = stm32prog_write(data,
|
||||
(u8 *)data->header_data,
|
||||
BL_HEADER_SIZE);
|
||||
}
|
||||
} else {
|
||||
if (ret)
|
||||
printf(" partition without checksum\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
free(data->header_data);
|
||||
data->header_data = NULL;
|
||||
/*pr_debug("%s result=%d\n", __func__, ret);*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u8 stm32prog_start(struct stm32prog_data *data, u32 address)
|
||||
{
|
||||
u8 ret = 0;
|
||||
struct dfu_entity *dfu_entity;
|
||||
|
||||
/*pr_debug("%s entry\n", __func__);*/
|
||||
|
||||
if (address < 0x100) {
|
||||
if (address == PHASE_OTP)
|
||||
return stm32prog_otp_start(data);
|
||||
|
||||
if (address == PHASE_PMIC)
|
||||
return stm32prog_pmic_start(data);
|
||||
|
||||
if (address == PHASE_RESET || address == PHASE_END) {
|
||||
data->cur_part = NULL;
|
||||
data->dfu_seq = 0;
|
||||
data->phase = address;
|
||||
return 0;
|
||||
}
|
||||
if (address != data->phase) {
|
||||
stm32prog_err("invalid received phase id %d, current phase is %d",
|
||||
(u8)address, (u8)data->phase);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
/* check the last loaded partition */
|
||||
if (address == DEFAULT_ADDRESS || address == data->phase) {
|
||||
switch (data->phase) {
|
||||
case PHASE_END:
|
||||
case PHASE_RESET:
|
||||
case PHASE_DO_RESET:
|
||||
data->cur_part = NULL;
|
||||
data->phase = PHASE_DO_RESET;
|
||||
return 0;
|
||||
}
|
||||
dfu_entity = stm32prog_get_entity(data);
|
||||
if (!dfu_entity)
|
||||
return -ENODEV;
|
||||
|
||||
if (data->dfu_seq) {
|
||||
ret = dfu_flush(dfu_entity, NULL, 0, data->dfu_seq);
|
||||
data->dfu_seq = 0;
|
||||
if (ret) {
|
||||
stm32prog_err("DFU flush failed [%d]", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
printf("\n received length = 0x%x\n", data->cursor);
|
||||
if (data->header.present) {
|
||||
if (data->cursor !=
|
||||
(data->header.image_length + BL_HEADER_SIZE)) {
|
||||
stm32prog_err("transmission interrupted (length=0x%x expected=0x%x)",
|
||||
data->cursor,
|
||||
data->header.image_length +
|
||||
BL_HEADER_SIZE);
|
||||
return -EIO;
|
||||
}
|
||||
if (data->header.image_checksum != data->checksum) {
|
||||
stm32prog_err("invalid checksum received (0x%x expected 0x%x)",
|
||||
data->checksum,
|
||||
data->header.image_checksum);
|
||||
return -EIO;
|
||||
}
|
||||
printf("\n checksum OK (0x%x)\n", data->checksum);
|
||||
}
|
||||
|
||||
stm32prog_end_phase(data);
|
||||
/* update DFU with received flashlayout */
|
||||
if (data->phase == PHASE_FLASHLAYOUT)
|
||||
stm32prog_dfu_init(data);
|
||||
/* found next selected partition */
|
||||
stm32prog_next_phase(data);
|
||||
} else {
|
||||
void (*entry)(void) = (void *)address;
|
||||
|
||||
printf("## Starting application at 0x%x ...\n", address);
|
||||
(*entry)();
|
||||
printf("## Application terminated\n");
|
||||
ret = -ENOEXEC;
|
||||
}
|
||||
/*pr_debug("%s exit ret=%d, phase=0x%x, add=0x%x\n", __func__,
|
||||
* ret, data->phase, address);
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : get_address
|
||||
* Description : Get address if it is valid
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : The address area or Error_32
|
||||
*/
|
||||
static u32 get_address(u8 *tmp_xor)
|
||||
{
|
||||
u32 address = 0x0;
|
||||
u8 data;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
*tmp_xor ^= data;
|
||||
address |= ((u32)data) << 24;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
address |= ((u32)data) << 16;
|
||||
*tmp_xor ^= data;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
address |= ((u32)data) << 8;
|
||||
*tmp_xor ^= data;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
address |= ((u32)data);
|
||||
*tmp_xor ^= data;
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
static void stm32prog_serial_result(u8 result)
|
||||
{
|
||||
/* always flush fifo before to send result */
|
||||
stm32prog_serial_flush();
|
||||
stm32prog_serial_putc(result);
|
||||
}
|
||||
|
||||
/* Command -----------------------------------------------*/
|
||||
/*
|
||||
* Function Name : get_cmd_command
|
||||
* Description : Respond to Get command
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
static void get_cmd_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 counter = 0x0;
|
||||
|
||||
stm32prog_serial_putc(NB_CMD);
|
||||
stm32prog_serial_putc(USART_BL_VERSION);
|
||||
|
||||
for (counter = 0; counter < NB_CMD; counter++)
|
||||
stm32prog_serial_putc(cmd_id[counter]);
|
||||
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : get_version_command
|
||||
* Description : Respond to Get Version command
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
static void get_version_command(struct stm32prog_data *data)
|
||||
{
|
||||
stm32prog_serial_putc(UBOOT_BL_VERSION);
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : get_id_command
|
||||
* Description : Respond to Get ID command
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
static void get_id_command(struct stm32prog_data *data)
|
||||
{
|
||||
/* Send Device IDCode */
|
||||
stm32prog_serial_putc(0x1);
|
||||
stm32prog_serial_putc(DEVICE_ID_BYTE1);
|
||||
stm32prog_serial_putc(DEVICE_ID_BYTE2);
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : get_phase_command
|
||||
* Description : Respond to Get phase
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
static void get_phase_command(struct stm32prog_data *data)
|
||||
{
|
||||
char *err_msg = NULL;
|
||||
u8 i, length = 0;
|
||||
u32 destination = DEFAULT_ADDRESS; /* destination address */
|
||||
int phase = data->phase;
|
||||
|
||||
if (phase == PHASE_RESET || phase == PHASE_DO_RESET) {
|
||||
err_msg = stm32prog_get_error(data);
|
||||
length = strlen(err_msg);
|
||||
}
|
||||
if (phase == PHASE_FLASHLAYOUT)
|
||||
destination = STM32_DDR_BASE;
|
||||
|
||||
stm32prog_serial_putc(length + 5); /* Total length */
|
||||
stm32prog_serial_putc(phase & 0xFF); /* partition ID */
|
||||
stm32prog_serial_putc(destination); /* byte 1 of address */
|
||||
stm32prog_serial_putc(destination >> 8); /* byte 2 of address */
|
||||
stm32prog_serial_putc(destination >> 16); /* byte 3 of address */
|
||||
stm32prog_serial_putc(destination >> 24); /* byte 4 of address */
|
||||
|
||||
stm32prog_serial_putc(length); /* Information length */
|
||||
for (i = 0; i < length; i++)
|
||||
stm32prog_serial_putc(err_msg[i]);
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
if (phase == PHASE_RESET)
|
||||
stm32prog_do_reset(data);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : read_memory_command
|
||||
* Description : Read data from memory
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
static void read_memory_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 address = 0x0;
|
||||
u8 rcv_data = 0x0, tmp_xor = 0x0;
|
||||
u32 counter = 0x0;
|
||||
|
||||
/* Read memory address */
|
||||
address = get_address(&tmp_xor);
|
||||
|
||||
/* If address memory is not received correctly */
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if (rcv_data != tmp_xor) {
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
return;
|
||||
}
|
||||
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
/* Read the number of bytes to be received:
|
||||
* Max NbrOfData = Data + 1 = 256
|
||||
*/
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
tmp_xor = ~rcv_data;
|
||||
if (stm32prog_serial_getc() != tmp_xor) {
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If checksum is correct send ACK */
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
/* Send data to the host:
|
||||
* Number of data to read = data + 1
|
||||
*/
|
||||
for (counter = (rcv_data + 1); counter != 0; counter--)
|
||||
stm32prog_serial_putc(*(u8 *)(address++));
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : start_command
|
||||
* Description : Jump to user application in RAM or partition check
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
static void start_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 address = 0;
|
||||
u8 tmp_xor = 0x0;
|
||||
u8 ret, rcv_data;
|
||||
|
||||
/* Read memory address */
|
||||
address = get_address(&tmp_xor);
|
||||
|
||||
/* If address memory is not received correctly */
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if (rcv_data != tmp_xor) {
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
return;
|
||||
}
|
||||
/* validate partition */
|
||||
ret = stm32prog_start(data,
|
||||
address);
|
||||
|
||||
if (ret)
|
||||
stm32prog_serial_result(ABORT_BYTE);
|
||||
else
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : download_command
|
||||
* Description : Write data to Flash
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : Result
|
||||
*/
|
||||
static void download_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 address = 0x0;
|
||||
u8 my_xor = 0x0;
|
||||
u8 rcv_xor;
|
||||
u32 counter = 0x0, codesize = 0x0;
|
||||
u8 *ramaddress = 0;
|
||||
u8 rcv_data = 0x0;
|
||||
struct image_header_s *image_header = &data->header;
|
||||
u32 cursor = data->cursor;
|
||||
long size = 0;
|
||||
u8 operation;
|
||||
u32 packet_number;
|
||||
u32 result = ACK_BYTE;
|
||||
u8 ret;
|
||||
unsigned int i;
|
||||
bool error;
|
||||
int rcv;
|
||||
|
||||
address = get_address(&my_xor);
|
||||
|
||||
/* If address memory is not received correctly */
|
||||
rcv_xor = stm32prog_serial_getc();
|
||||
if (rcv_xor != my_xor) {
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* If address valid send ACK */
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
/* get packet number and operation type */
|
||||
operation = (u8)((u32)address >> 24);
|
||||
packet_number = ((u32)(((u32)address << 8))) >> 8;
|
||||
|
||||
switch (operation) {
|
||||
/* supported operation */
|
||||
case PHASE_FLASHLAYOUT:
|
||||
case PHASE_OTP:
|
||||
case PHASE_PMIC:
|
||||
break;
|
||||
default:
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
/* check the packet number */
|
||||
if (packet_number == 0) {
|
||||
/* erase: re-initialize the image_header struct */
|
||||
data->packet_number = 0;
|
||||
if (data->header_data)
|
||||
memset(data->header_data, 0, BL_HEADER_SIZE);
|
||||
else
|
||||
data->header_data = calloc(1, BL_HEADER_SIZE);
|
||||
cursor = 0;
|
||||
data->cursor = 0;
|
||||
data->checksum = 0;
|
||||
/*idx = cursor;*/
|
||||
} else {
|
||||
data->packet_number++;
|
||||
}
|
||||
|
||||
/* Check with the number of current packet if the device receive
|
||||
* the true packet
|
||||
*/
|
||||
if (packet_number != data->packet_number) {
|
||||
data->packet_number--;
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*-- Read number of bytes to be written and data -----------*/
|
||||
|
||||
/* Read the number of bytes to be written:
|
||||
* Max NbrOfData = data + 1 <= 256
|
||||
*/
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
|
||||
/* NbrOfData to write = data + 1 */
|
||||
codesize = rcv_data + 0x01;
|
||||
|
||||
if (codesize > USART_RAM_BUFFER_SIZE) {
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Checksum Initialization */
|
||||
my_xor = rcv_data;
|
||||
|
||||
/* UART receive data and send to Buffer */
|
||||
counter = codesize;
|
||||
error = stm32prog_serial_get_buffer(data->buffer, &counter);
|
||||
|
||||
/* read checksum */
|
||||
if (!error) {
|
||||
rcv = stm32prog_serial_getc_err();
|
||||
error = !!(rcv < 0);
|
||||
rcv_xor = rcv;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
printf("transmission error on packet %d, byte %d\n",
|
||||
packet_number, codesize - counter);
|
||||
/* waiting end of packet before flush & NACK */
|
||||
mdelay(30);
|
||||
data->packet_number--;
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Compute Checksum */
|
||||
ramaddress = data->buffer;
|
||||
for (counter = codesize; counter != 0; counter--)
|
||||
my_xor ^= *(ramaddress++);
|
||||
|
||||
/* If Checksum is incorrect */
|
||||
if (rcv_xor != my_xor) {
|
||||
printf("checksum error on packet %d\n",
|
||||
packet_number);
|
||||
/* wait to be sure that all data are received
|
||||
* in the FIFO before flush
|
||||
*/
|
||||
mdelay(30);
|
||||
data->packet_number--;
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Update current position in buffer */
|
||||
data->cursor += codesize;
|
||||
|
||||
if (operation == PHASE_OTP) {
|
||||
size = data->cursor - cursor;
|
||||
/* no header for OTP */
|
||||
if (stm32prog_otp_write(data, cursor,
|
||||
data->buffer, &size))
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (operation == PHASE_PMIC) {
|
||||
size = data->cursor - cursor;
|
||||
/* no header for PMIC */
|
||||
if (stm32prog_pmic_write(data, cursor,
|
||||
data->buffer, &size))
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (cursor < BL_HEADER_SIZE) {
|
||||
/* size = portion of header in this chunck */
|
||||
if (data->cursor >= BL_HEADER_SIZE)
|
||||
size = BL_HEADER_SIZE - cursor;
|
||||
else
|
||||
size = data->cursor - cursor;
|
||||
memcpy((void *)((u32)(data->header_data) + cursor),
|
||||
data->buffer, size);
|
||||
cursor += size;
|
||||
|
||||
if (cursor == BL_HEADER_SIZE) {
|
||||
/* Check and Write the header */
|
||||
if (stm32prog_header(data)) {
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* pr_debug("packet_number = 0x%x\n", packet_number);
|
||||
* pr_debug("cursor = 0x%x\n", data->cursor);
|
||||
* pr_debug("image_length = 0x%x\n", image_header->image_length);
|
||||
* pr_debug("codesize = 0x%x\n", codesize);
|
||||
*/
|
||||
if (image_header->present) {
|
||||
if (data->cursor <= BL_HEADER_SIZE)
|
||||
goto end;
|
||||
/* compute checksum on payload */
|
||||
for (i = (unsigned long)size; i < codesize; i++)
|
||||
data->checksum += data->buffer[i];
|
||||
|
||||
if (data->cursor >
|
||||
image_header->image_length + BL_HEADER_SIZE) {
|
||||
pr_err("expected size exceeded\n");
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* write data (payload) */
|
||||
ret = stm32prog_write(data,
|
||||
&data->buffer[size],
|
||||
codesize - size);
|
||||
} else {
|
||||
/* write all */
|
||||
ret = stm32prog_write(data,
|
||||
data->buffer,
|
||||
codesize);
|
||||
}
|
||||
if (ret)
|
||||
result = ABORT_BYTE;
|
||||
|
||||
end:
|
||||
/*pr_debug("%s : result = 0x%x\n", __func__, result);*/
|
||||
stm32prog_serial_result(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Name : read_partition
|
||||
* Description : read data from Flash
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : Result
|
||||
*/
|
||||
static void read_partition_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 i, part_id, codesize, offset = 0, rcv_data;
|
||||
long size;
|
||||
u8 tmp_xor;
|
||||
int res;
|
||||
u8 buffer[256];
|
||||
|
||||
part_id = stm32prog_serial_getc();
|
||||
tmp_xor = part_id;
|
||||
|
||||
offset = get_address(&tmp_xor);
|
||||
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if (rcv_data != tmp_xor) {
|
||||
pr_debug("1st checksum received = %x, computed %x\n",
|
||||
rcv_data, tmp_xor);
|
||||
goto error;
|
||||
}
|
||||
stm32prog_serial_putc(ACK_BYTE);
|
||||
|
||||
/* NbrOfData to read = data + 1 */
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
codesize = rcv_data + 0x01;
|
||||
tmp_xor = rcv_data;
|
||||
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if ((rcv_data ^ tmp_xor) != 0xFF) {
|
||||
pr_debug("2nd checksum received = %x, computed %x\n",
|
||||
rcv_data, tmp_xor);
|
||||
goto error;
|
||||
}
|
||||
|
||||
pr_debug("%s : %x\n", __func__, part_id);
|
||||
rcv_data = 0;
|
||||
switch (part_id) {
|
||||
case PHASE_OTP:
|
||||
size = codesize;
|
||||
if (!stm32prog_otp_read(data, offset, buffer, &size))
|
||||
rcv_data = size;
|
||||
break;
|
||||
case PHASE_PMIC:
|
||||
size = codesize;
|
||||
if (!stm32prog_pmic_read(data, offset, buffer, &size))
|
||||
rcv_data = size;
|
||||
break;
|
||||
default:
|
||||
res = stm32prog_read(data, part_id, offset,
|
||||
buffer, codesize);
|
||||
if (res > 0)
|
||||
rcv_data = res;
|
||||
break;
|
||||
}
|
||||
if (rcv_data > 0) {
|
||||
stm32prog_serial_putc(ACK_BYTE);
|
||||
/*----------- Send data to the host -----------*/
|
||||
for (i = 0; i < rcv_data; i++)
|
||||
stm32prog_serial_putc(buffer[i]);
|
||||
/*----------- Send filler to the host -----------*/
|
||||
for (; i < codesize; i++)
|
||||
stm32prog_serial_putc(0x0);
|
||||
return;
|
||||
}
|
||||
stm32prog_serial_result(ABORT_BYTE);
|
||||
return;
|
||||
|
||||
error:
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
}
|
||||
|
||||
/** SERIAL LOOP ****************************************************/
|
||||
|
||||
/*
|
||||
* Function Name : stm32prog_serial_loop
|
||||
* Description : USART bootloader Loop routine
|
||||
* Input : data
|
||||
* Output : None
|
||||
* Return : None
|
||||
*/
|
||||
bool stm32prog_serial_loop(struct stm32prog_data *data)
|
||||
{
|
||||
u32 counter = 0x0;
|
||||
u8 command = 0x0;
|
||||
u8 found;
|
||||
int phase = data->phase;
|
||||
|
||||
/* element of cmd_func need to aligned with cmd_id[]*/
|
||||
void (*cmd_func[NB_CMD])(struct stm32prog_data *) = {
|
||||
/* GET_CMD_COMMAND */ get_cmd_command,
|
||||
/* GET_VER_COMMAND */ get_version_command,
|
||||
/* GET_ID_COMMAND */ get_id_command,
|
||||
/* GET_PHASE_COMMAND */ get_phase_command,
|
||||
/* RM_COMMAND */ read_memory_command,
|
||||
/* READ_PART_COMMAND */ read_partition_command,
|
||||
/* START_COMMAND */ start_command,
|
||||
/* DOWNLOAD_COMMAND */ download_command
|
||||
};
|
||||
|
||||
/* flush and NACK pending command received during u-boot init
|
||||
* request command reemit
|
||||
*/
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
|
||||
clear_ctrlc(); /* forget any previous Control C */
|
||||
while (!had_ctrlc()) {
|
||||
phase = data->phase;
|
||||
|
||||
if (phase == PHASE_DO_RESET)
|
||||
return true;
|
||||
|
||||
/* Get the user command: read first byte */
|
||||
command = stm32prog_serial_getc();
|
||||
|
||||
if (command == INIT_BYTE) {
|
||||
puts("\nConnected\n");
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
continue;
|
||||
}
|
||||
|
||||
found = 0;
|
||||
for (counter = 0; counter < NB_CMD; counter++)
|
||||
if (cmd_id[counter] == command) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
if ((command ^ stm32prog_serial_getc()) != 0xFF)
|
||||
found = 0;
|
||||
if (!found) {
|
||||
/* wait to be sure that all data are received
|
||||
* in the FIFO before flush (CMD and XOR)
|
||||
*/
|
||||
mdelay(3);
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
} else {
|
||||
/*pr_debug("+ cmd %x\n", counter);*/
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
cmd_func[counter](data);
|
||||
}
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
|
||||
/* clean device */
|
||||
if (gd->cur_serial_dev == down_serial_dev) {
|
||||
/* restore console on uart */
|
||||
gd->flags &= ~(GD_FLG_DISABLE_CONSOLE | GD_FLG_SILENT);
|
||||
}
|
||||
down_serial_dev = NULL;
|
||||
|
||||
return false; /* no reset after ctrlc */
|
||||
}
|
||||
285
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
Normal file
285
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
Normal file
@ -0,0 +1,285 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <dfu.h>
|
||||
#include <g_dnl.h>
|
||||
#include <usb.h>
|
||||
#include <watchdog.h>
|
||||
#include "stm32prog.h"
|
||||
|
||||
struct stm32prog_data *stm32prog_data;
|
||||
|
||||
static int stm32prog_get_alternate(struct stm32prog_data *data)
|
||||
{
|
||||
if (data->cur_part)
|
||||
return data->cur_part->alt_id;
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int stm32prog_set_phase(struct stm32prog_data *data, u8 phase,
|
||||
u32 offset)
|
||||
{
|
||||
struct stm32prog_part_t *part;
|
||||
int i;
|
||||
|
||||
if (phase == data->phase) {
|
||||
data->offset = offset;
|
||||
data->dfu_seq = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* found partition */
|
||||
for (i = 0; i < data->part_nb; i++) {
|
||||
part = &data->part_array[i];
|
||||
if (part->id == phase) {
|
||||
data->cur_part = part;
|
||||
data->phase = phase;
|
||||
data->offset = offset;
|
||||
data->dfu_seq = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int stm32prog_cmd_write(u64 offset, void *buf, long *len)
|
||||
{
|
||||
u8 phase;
|
||||
u32 address;
|
||||
u8 *pt = buf;
|
||||
void (*entry)(void);
|
||||
int ret;
|
||||
|
||||
if (*len < 5) {
|
||||
pr_err("size not allowed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (offset) {
|
||||
pr_err("invalid offset\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
phase = pt[0];
|
||||
address = (pt[1] << 24) | (pt[2] << 16) | (pt[3] << 8) | pt[4];
|
||||
if (phase == PHASE_RESET) {
|
||||
entry = (void *)address;
|
||||
printf("## Starting application at 0x%x ...\n", address);
|
||||
(*entry)();
|
||||
printf("## Application terminated\n");
|
||||
return 0;
|
||||
}
|
||||
/* set phase and offset */
|
||||
ret = stm32prog_set_phase(stm32prog_data, phase, address);
|
||||
if (ret)
|
||||
pr_err("failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define PHASE_MIN_SIZE 9
|
||||
static int stm32prog_cmd_read(u64 offset, void *buf, long *len)
|
||||
{
|
||||
u32 destination = DEFAULT_ADDRESS; /* destination address */
|
||||
u32 dfu_offset;
|
||||
u8 *pt_buf = buf;
|
||||
int phase;
|
||||
char *err_msg;
|
||||
int length;
|
||||
|
||||
if (*len < PHASE_MIN_SIZE) {
|
||||
pr_err("request exceeds allowed area\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (offset) {
|
||||
*len = 0; /* EOF for second request */
|
||||
return 0;
|
||||
}
|
||||
phase = stm32prog_data->phase;
|
||||
if (phase == PHASE_FLASHLAYOUT)
|
||||
destination = STM32_DDR_BASE;
|
||||
dfu_offset = stm32prog_data->offset;
|
||||
|
||||
/* mandatory header, size = PHASE_MIN_SIZE */
|
||||
*pt_buf++ = (u8)(phase & 0xFF);
|
||||
*pt_buf++ = (u8)(destination);
|
||||
*pt_buf++ = (u8)(destination >> 8);
|
||||
*pt_buf++ = (u8)(destination >> 16);
|
||||
*pt_buf++ = (u8)(destination >> 24);
|
||||
*pt_buf++ = (u8)(dfu_offset);
|
||||
*pt_buf++ = (u8)(dfu_offset >> 8);
|
||||
*pt_buf++ = (u8)(dfu_offset >> 16);
|
||||
*pt_buf++ = (u8)(dfu_offset >> 24);
|
||||
|
||||
if (phase == PHASE_RESET || phase == PHASE_DO_RESET) {
|
||||
err_msg = stm32prog_get_error(stm32prog_data);
|
||||
length = strlen(err_msg);
|
||||
if (length + PHASE_MIN_SIZE > *len)
|
||||
length = *len - PHASE_MIN_SIZE;
|
||||
|
||||
memcpy(pt_buf, err_msg, length);
|
||||
*len = PHASE_MIN_SIZE + length;
|
||||
stm32prog_do_reset(stm32prog_data);
|
||||
} else if (phase == PHASE_FLASHLAYOUT) {
|
||||
*pt_buf++ = stm32prog_data->part_nb ? 1 : 0;
|
||||
*len = PHASE_MIN_SIZE + 1;
|
||||
} else {
|
||||
*len = PHASE_MIN_SIZE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* DFU access to virtual partition */
|
||||
|
||||
void dfu_flush_callback(struct dfu_entity *dfu)
|
||||
{
|
||||
if (!stm32prog_data)
|
||||
return;
|
||||
|
||||
if (dfu->dev_type == DFU_DEV_VIRT) {
|
||||
if (dfu->data.virt.dev_num == PHASE_OTP)
|
||||
stm32prog_otp_start(stm32prog_data);
|
||||
else if (dfu->data.virt.dev_num == PHASE_PMIC)
|
||||
stm32prog_pmic_start(stm32prog_data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dfu->dev_type == DFU_DEV_RAM) {
|
||||
if (dfu->alt == 0 &&
|
||||
stm32prog_data->phase == PHASE_FLASHLAYOUT) {
|
||||
stm32prog_end_phase(stm32prog_data);
|
||||
/* waiting DFU DETACH for reenumeration */
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (dfu->alt == stm32prog_get_alternate(stm32prog_data)) {
|
||||
stm32prog_end_phase(stm32prog_data);
|
||||
stm32prog_next_phase(stm32prog_data);
|
||||
}
|
||||
}
|
||||
|
||||
void dfu_initiated_callback(struct dfu_entity *dfu)
|
||||
{
|
||||
int phase;
|
||||
|
||||
if (!stm32prog_data)
|
||||
return;
|
||||
|
||||
phase = stm32prog_data->phase;
|
||||
if (dfu->alt == stm32prog_get_alternate(stm32prog_data)) {
|
||||
dfu->offset = stm32prog_data->offset;
|
||||
stm32prog_set_phase(stm32prog_data, phase, 0);
|
||||
pr_debug("dfu offset = 0x%llx\n", dfu->offset);
|
||||
}
|
||||
}
|
||||
|
||||
int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len)
|
||||
{
|
||||
if (dfu->dev_type != DFU_DEV_VIRT)
|
||||
return -EINVAL;
|
||||
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case PHASE_CMD:
|
||||
return stm32prog_cmd_write(offset, buf, len);
|
||||
|
||||
case PHASE_OTP:
|
||||
return stm32prog_otp_write(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
|
||||
case PHASE_PMIC:
|
||||
return stm32prog_pmic_write(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
}
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len)
|
||||
{
|
||||
if (dfu->dev_type != DFU_DEV_VIRT)
|
||||
return -EINVAL;
|
||||
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case PHASE_CMD:
|
||||
return stm32prog_cmd_read(offset, buf, len);
|
||||
|
||||
case PHASE_OTP:
|
||||
return stm32prog_otp_read(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
|
||||
case PHASE_PMIC:
|
||||
return stm32prog_pmic_read(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
}
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dfu_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
|
||||
{
|
||||
if (dfu->dev_type != DFU_DEV_VIRT) {
|
||||
*size = 0;
|
||||
pr_debug("%s, invalid dev_type = %d\n",
|
||||
__func__, dfu->dev_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case PHASE_CMD:
|
||||
*size = 512;
|
||||
break;
|
||||
case PHASE_OTP:
|
||||
*size = OTP_SIZE;
|
||||
break;
|
||||
case PHASE_PMIC:
|
||||
*size = PMIC_SIZE;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* USB download gadget for STM32 Programmer */
|
||||
|
||||
static const char product[] =
|
||||
"USB download gadget@Device ID /0x500, @Revision ID /0x0000";
|
||||
|
||||
bool stm32prog_usb_loop(struct stm32prog_data *data, int dev)
|
||||
{
|
||||
int ret;
|
||||
bool result;
|
||||
|
||||
stm32prog_data = data;
|
||||
g_dnl_set_product(product);
|
||||
if (stm32prog_data->phase == PHASE_FLASHLAYOUT) {
|
||||
ret = run_usb_dnl_gadget(dev, "usb_dnl_dfu");
|
||||
if (ret || stm32prog_data->phase == PHASE_DO_RESET)
|
||||
return ret;
|
||||
/* prepare the second enumeration with the FlashLayout */
|
||||
if (stm32prog_data->phase == PHASE_FLASHLAYOUT)
|
||||
stm32prog_dfu_init(data);
|
||||
/* found next selected partition */
|
||||
stm32prog_next_phase(data);
|
||||
}
|
||||
|
||||
ret = run_usb_dnl_gadget(dev, "usb_dnl_dfu") ;
|
||||
|
||||
result = !!(ret) || (stm32prog_data->phase == PHASE_DO_RESET);
|
||||
|
||||
stm32prog_data = NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int g_dnl_get_board_bcd_device_number(int gcnum)
|
||||
{
|
||||
pr_debug("%s\n", __func__);
|
||||
return 0x200;
|
||||
}
|
||||
@ -3,7 +3,21 @@
|
||||
# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
#
|
||||
|
||||
ALL-$(CONFIG_SPL_BUILD) += spl/u-boot-spl.stm32
|
||||
ifndef CONFIG_SPL
|
||||
ALL-y += u-boot.stm32
|
||||
else
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
ALL-y += u-boot-spl.stm32
|
||||
endif
|
||||
endif
|
||||
|
||||
MKIMAGEFLAGS_u-boot.stm32 = -T stm32image -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
u-boot.stm32: MKIMAGEOUTPUT = u-boot.stm32.log
|
||||
|
||||
u-boot.stm32: u-boot.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
|
||||
MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE)
|
||||
|
||||
@ -11,3 +25,6 @@ spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log
|
||||
|
||||
spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
u-boot-spl.stm32 : spl/u-boot-spl.stm32
|
||||
$(call if_changed,copy)
|
||||
|
||||
@ -6,18 +6,24 @@
|
||||
#include <clk.h>
|
||||
#include <debug_uart.h>
|
||||
#include <environment.h>
|
||||
#include <fdt_support.h>
|
||||
#include <misc.h>
|
||||
#include <wdt.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/stm32.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <dm/device.h>
|
||||
#include <dm/lists.h>
|
||||
#include <dm/uclass.h>
|
||||
#include <dt-bindings/clock/stm32mp1-clks.h>
|
||||
|
||||
/* RCC register */
|
||||
#define RCC_TZCR (STM32_RCC_BASE + 0x00)
|
||||
#define RCC_DBGCFGR (STM32_RCC_BASE + 0x080C)
|
||||
#define RCC_BDCR (STM32_RCC_BASE + 0x0140)
|
||||
#define RCC_MP_APB5ENSETR (STM32_RCC_BASE + 0x0208)
|
||||
#define RCC_MP_AHB5ENSETR (STM32_RCC_BASE + 0x0210)
|
||||
|
||||
#define RCC_BDCR_VSWRST BIT(31)
|
||||
#define RCC_BDCR_RTCSRC GENMASK(17, 16)
|
||||
#define RCC_DBGCFGR_DBGCKEN BIT(8)
|
||||
@ -44,6 +50,9 @@
|
||||
#define DBGMCU_IDC_REV_ID_MASK GENMASK(31, 16)
|
||||
#define DBGMCU_IDC_REV_ID_SHIFT 16
|
||||
|
||||
/* GPIOZ registers */
|
||||
#define GPIOZ_SECCFGR 0x54004030
|
||||
|
||||
/* boot interface from Bootrom
|
||||
* - boot instance = bit 31:16
|
||||
* - boot device = bit 15:0
|
||||
@ -55,10 +64,29 @@
|
||||
#define BOOTROM_INSTANCE_SHIFT 16
|
||||
|
||||
/* BSEC OTP index */
|
||||
#define BSEC_OTP_RPN 1
|
||||
#define BSEC_OTP_SERIAL 13
|
||||
#define BSEC_OTP_PKG 16
|
||||
#define BSEC_OTP_MAC 57
|
||||
|
||||
/* Device Part Number (RPN) = OTP_DATA1 lower 8 bits */
|
||||
#define RPN_SHIFT 0
|
||||
#define RPN_MASK GENMASK(7, 0)
|
||||
|
||||
/* Package = bit 27:29 of OTP16
|
||||
* - 100: LBGA448 (FFI) => AA = LFBGA 18x18mm 448 balls p. 0.8mm
|
||||
* - 011: LBGA354 (LCI) => AB = LFBGA 16x16mm 359 balls p. 0.8mm
|
||||
* - 010: TFBGA361 (FFC) => AC = TFBGA 12x12mm 361 balls p. 0.5mm
|
||||
* - 001: TFBGA257 (LCC) => AD = TFBGA 10x10mm 257 balls p. 0.5mm
|
||||
* - others: Reserved
|
||||
*/
|
||||
#define PKG_SHIFT 27
|
||||
#define PKG_MASK GENMASK(2, 0)
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
static void security_init(void)
|
||||
{
|
||||
/* Disable the backup domain write protection */
|
||||
@ -113,7 +141,12 @@ static void security_init(void)
|
||||
* Bit 16 ITAMP1E: RTC power domain supply monitoring
|
||||
*/
|
||||
writel(0x0, TAMP_CR1);
|
||||
|
||||
/* GPIOZ: deactivate the security */
|
||||
writel(BIT(0), RCC_MP_AHB5ENSETR);
|
||||
writel(0x0, GPIOZ_SECCFGR);
|
||||
}
|
||||
#endif /* CONFIG_STM32MP1_TRUSTED */
|
||||
|
||||
/*
|
||||
* Debug init
|
||||
@ -127,13 +160,19 @@ static void dbgmcu_init(void)
|
||||
}
|
||||
#endif /* !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) */
|
||||
|
||||
static u32 get_bootmode(void)
|
||||
#if !defined(CONFIG_STM32MP1_TRUSTED) && \
|
||||
(!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD))
|
||||
/* get bootmode from ROM code boot context: saved in TAMP register */
|
||||
static void update_bootmode(void)
|
||||
{
|
||||
u32 boot_mode;
|
||||
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
|
||||
u32 bootrom_itf = readl(BOOTROM_PARAM_ADDR);
|
||||
u32 bootrom_device, bootrom_instance;
|
||||
|
||||
/* enable TAMP clock = RTCAPBEN */
|
||||
writel(BIT(8), RCC_MP_APB5ENSETR);
|
||||
|
||||
/* read bootrom context */
|
||||
bootrom_device =
|
||||
(bootrom_itf & BOOTROM_MODE_MASK) >> BOOTROM_MODE_SHIFT;
|
||||
bootrom_instance =
|
||||
@ -147,12 +186,14 @@ static u32 get_bootmode(void)
|
||||
clrsetbits_le32(TAMP_BOOT_CONTEXT,
|
||||
TAMP_BOOT_MODE_MASK,
|
||||
boot_mode << TAMP_BOOT_MODE_SHIFT);
|
||||
#else
|
||||
/* read TAMP backup register */
|
||||
boot_mode = (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_MODE_MASK) >>
|
||||
TAMP_BOOT_MODE_SHIFT;
|
||||
}
|
||||
#endif
|
||||
return boot_mode;
|
||||
|
||||
u32 get_bootmode(void)
|
||||
{
|
||||
/* read bootmode from TAMP backup register */
|
||||
return (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_MODE_MASK) >>
|
||||
TAMP_BOOT_MODE_SHIFT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -167,16 +208,18 @@ int arch_cpu_init(void)
|
||||
|
||||
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
|
||||
dbgmcu_init();
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
security_init();
|
||||
update_bootmode();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* get bootmode from BootRom context: saved in TAMP register */
|
||||
boot_mode = get_bootmode();
|
||||
|
||||
if ((boot_mode & TAMP_BOOT_DEVICE_MASK) == BOOT_SERIAL_UART)
|
||||
gd->flags |= GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
|
||||
#if defined(CONFIG_DEBUG_UART) && \
|
||||
!defined(CONFIG_STM32MP1_TRUSTED) && \
|
||||
(!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD))
|
||||
else
|
||||
debug_uart_init();
|
||||
@ -203,25 +246,112 @@ u32 get_cpu_rev(void)
|
||||
return (read_idc() & DBGMCU_IDC_REV_ID_MASK) >> DBGMCU_IDC_REV_ID_SHIFT;
|
||||
}
|
||||
|
||||
static u32 get_otp(int index, int shift, int mask)
|
||||
{
|
||||
int ret;
|
||||
struct udevice *dev;
|
||||
u32 otp = 0;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
|
||||
if (!ret)
|
||||
ret = misc_read(dev, STM32_BSEC_SHADOW(index),
|
||||
&otp, sizeof(otp));
|
||||
|
||||
return (otp >> shift) & mask;
|
||||
}
|
||||
|
||||
/* Get Device Part Number (RPN) from OTP */
|
||||
static u32 get_cpu_rpn(void)
|
||||
{
|
||||
return get_otp(BSEC_OTP_RPN, RPN_SHIFT, RPN_MASK);
|
||||
}
|
||||
|
||||
u32 get_cpu_type(void)
|
||||
{
|
||||
return (read_idc() & DBGMCU_IDC_DEV_ID_MASK) >> DBGMCU_IDC_DEV_ID_SHIFT;
|
||||
u32 id;
|
||||
|
||||
id = (read_idc() & DBGMCU_IDC_DEV_ID_MASK) >> DBGMCU_IDC_DEV_ID_SHIFT;
|
||||
|
||||
return (id << 16) | get_cpu_rpn();
|
||||
}
|
||||
|
||||
/* Get Package options from OTP */
|
||||
u32 get_cpu_package(void)
|
||||
{
|
||||
return get_otp(BSEC_OTP_PKG, PKG_SHIFT, PKG_MASK);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
char *cpu_s, *cpu_r;
|
||||
char *cpu_s, *cpu_r, *pkg;
|
||||
|
||||
/* MPUs Part Numbers */
|
||||
switch (get_cpu_type()) {
|
||||
case CPU_STMP32MP15x:
|
||||
cpu_s = "15x";
|
||||
case CPU_STM32MP157Fxx:
|
||||
cpu_s = "157F";
|
||||
break;
|
||||
case CPU_STM32MP157Dxx:
|
||||
cpu_s = "157D";
|
||||
break;
|
||||
case CPU_STM32MP157Cxx:
|
||||
cpu_s = "157C";
|
||||
break;
|
||||
case CPU_STM32MP157Axx:
|
||||
cpu_s = "157A";
|
||||
break;
|
||||
case CPU_STM32MP153Fxx:
|
||||
cpu_s = "153F";
|
||||
break;
|
||||
case CPU_STM32MP153Dxx:
|
||||
cpu_s = "153D";
|
||||
break;
|
||||
case CPU_STM32MP153Cxx:
|
||||
cpu_s = "153C";
|
||||
break;
|
||||
case CPU_STM32MP153Axx:
|
||||
cpu_s = "153A";
|
||||
break;
|
||||
case CPU_STM32MP151Fxx:
|
||||
cpu_s = "151F";
|
||||
break;
|
||||
case CPU_STM32MP151Dxx:
|
||||
cpu_s = "151D";
|
||||
break;
|
||||
case CPU_STM32MP151Cxx:
|
||||
cpu_s = "151C";
|
||||
break;
|
||||
case CPU_STM32MP151Axx:
|
||||
cpu_s = "151A";
|
||||
break;
|
||||
default:
|
||||
cpu_s = "?";
|
||||
cpu_s = "????";
|
||||
break;
|
||||
}
|
||||
|
||||
/* Package */
|
||||
switch (get_cpu_package()) {
|
||||
case PKG_AA_LBGA448:
|
||||
pkg = "AA";
|
||||
break;
|
||||
case PKG_AB_LBGA354:
|
||||
pkg = "AB";
|
||||
break;
|
||||
case PKG_AC_TFBGA361:
|
||||
pkg = "AC";
|
||||
break;
|
||||
case PKG_AD_TFBGA257:
|
||||
pkg = "AD";
|
||||
break;
|
||||
default:
|
||||
pkg = "??";
|
||||
break;
|
||||
}
|
||||
|
||||
/* REVISION */
|
||||
switch (get_cpu_rev()) {
|
||||
case CPU_REVA:
|
||||
cpu_r = "A";
|
||||
@ -229,12 +359,15 @@ int print_cpuinfo(void)
|
||||
case CPU_REVB:
|
||||
cpu_r = "B";
|
||||
break;
|
||||
case CPU_REVZ:
|
||||
cpu_r = "Z";
|
||||
break;
|
||||
default:
|
||||
cpu_r = "?";
|
||||
break;
|
||||
}
|
||||
|
||||
printf("CPU: STM32MP%s.%s\n", cpu_s, cpu_r);
|
||||
printf("CPU: STM32MP%s%s Rev.%s\n", cpu_s, pkg, cpu_r);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -242,20 +375,48 @@ int print_cpuinfo(void)
|
||||
|
||||
static void setup_boot_mode(void)
|
||||
{
|
||||
const u32 serial_addr[] = {
|
||||
STM32_USART1_BASE,
|
||||
STM32_USART2_BASE,
|
||||
STM32_USART3_BASE,
|
||||
STM32_UART4_BASE,
|
||||
STM32_UART5_BASE,
|
||||
STM32_USART6_BASE,
|
||||
STM32_UART7_BASE,
|
||||
STM32_UART8_BASE
|
||||
};
|
||||
char cmd[60];
|
||||
u32 boot_ctx = readl(TAMP_BOOT_CONTEXT);
|
||||
u32 boot_mode =
|
||||
(boot_ctx & TAMP_BOOT_MODE_MASK) >> TAMP_BOOT_MODE_SHIFT;
|
||||
int instance = (boot_mode & TAMP_BOOT_INSTANCE_MASK) - 1;
|
||||
|
||||
pr_debug("%s: boot_ctx=0x%x => boot_mode=%x, instance=%d\n",
|
||||
__func__, boot_ctx, boot_mode, instance);
|
||||
unsigned int instance = (boot_mode & TAMP_BOOT_INSTANCE_MASK) - 1;
|
||||
u32 forced_mode = (boot_ctx & TAMP_BOOT_FORCED_MASK);
|
||||
struct udevice *dev;
|
||||
int alias;
|
||||
|
||||
debug("%s: boot_ctx=0x%x => boot_mode=%x, instance=%d forced=%x\n",
|
||||
__func__, boot_ctx, boot_mode, instance, forced_mode);
|
||||
switch (boot_mode & TAMP_BOOT_DEVICE_MASK) {
|
||||
case BOOT_SERIAL_UART:
|
||||
sprintf(cmd, "%d", instance);
|
||||
env_set("boot_device", "uart");
|
||||
if (instance > ARRAY_SIZE(serial_addr))
|
||||
break;
|
||||
/* serial : search associated alias in devicetree */
|
||||
sprintf(cmd, "serial@%x", serial_addr[instance]);
|
||||
if (uclass_get_device_by_name(UCLASS_SERIAL, cmd, &dev))
|
||||
break;
|
||||
if (fdtdec_get_alias_seq(gd->fdt_blob, "serial",
|
||||
dev_of_offset(dev), &alias))
|
||||
break;
|
||||
sprintf(cmd, "%d", alias);
|
||||
env_set("boot_device", "serial");
|
||||
env_set("boot_instance", cmd);
|
||||
|
||||
/* restore console on uart when not used */
|
||||
if (gd->cur_serial_dev != dev) {
|
||||
gd->flags &= ~(GD_FLG_SILENT |
|
||||
GD_FLG_DISABLE_CONSOLE);
|
||||
printf("serial boot with console enabled!\n");
|
||||
}
|
||||
break;
|
||||
case BOOT_SERIAL_USB:
|
||||
env_set("boot_device", "usb");
|
||||
@ -279,6 +440,36 @@ static void setup_boot_mode(void)
|
||||
pr_debug("unexpected boot mode = %x\n", boot_mode);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (forced_mode) {
|
||||
case BOOT_FASTBOOT:
|
||||
printf("Enter fastboot!\n");
|
||||
env_set("preboot", "env set preboot; fastboot 0");
|
||||
break;
|
||||
case BOOT_STM32PROG:
|
||||
env_set("boot_device", "usb");
|
||||
env_set("boot_instance", "0");
|
||||
break;
|
||||
case BOOT_UMS_MMC0:
|
||||
case BOOT_UMS_MMC1:
|
||||
case BOOT_UMS_MMC2:
|
||||
printf("Enter UMS!\n");
|
||||
instance = forced_mode - BOOT_UMS_MMC0;
|
||||
sprintf(cmd, "env set preboot; ums 0 mmc %d", instance);
|
||||
env_set("preboot", cmd);
|
||||
break;
|
||||
case BOOT_RECOVERY:
|
||||
env_set("preboot", "env set preboot; run altbootcmd");
|
||||
break;
|
||||
case BOOT_NORMAL:
|
||||
break;
|
||||
default:
|
||||
pr_debug("unexpected forced boot mode = %x\n", forced_mode);
|
||||
break;
|
||||
}
|
||||
|
||||
/* clear TAMP for next reboot */
|
||||
clrsetbits_le32(TAMP_BOOT_CONTEXT, TAMP_BOOT_FORCED_MASK, BOOT_NORMAL);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -292,19 +483,16 @@ static int setup_mac_address(void)
|
||||
int i;
|
||||
u32 otp[2];
|
||||
uchar enetaddr[6];
|
||||
char buf[ARP_HLEN_ASCII + 1];
|
||||
struct udevice *dev;
|
||||
|
||||
/* MAC already in environment */
|
||||
if (eth_env_get_enetaddr("ethaddr", enetaddr))
|
||||
return 0;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = misc_read(dev, BSEC_OTP_MAC * 4 + STM32_BSEC_OTP_OFFSET,
|
||||
ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_MAC),
|
||||
otp, sizeof(otp));
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -316,9 +504,11 @@ static int setup_mac_address(void)
|
||||
pr_err("invalid MAC address in OTP %pM", enetaddr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pr_debug("OTP MAC address = %pM\n", enetaddr);
|
||||
ret = !eth_env_set_enetaddr("ethaddr", enetaddr);
|
||||
if (!ret)
|
||||
sprintf(buf, "%pM", enetaddr);
|
||||
ret = env_set("ethaddr", buf);
|
||||
if (ret)
|
||||
pr_err("Failed to set mac address %pM from OTP: %d\n",
|
||||
enetaddr, ret);
|
||||
#endif
|
||||
@ -333,28 +523,78 @@ static int setup_serial_number(void)
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
if (env_get("serial#"))
|
||||
return 0;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = misc_read(dev, BSEC_OTP_SERIAL * 4 + STM32_BSEC_OTP_OFFSET,
|
||||
ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
|
||||
otp, sizeof(otp));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sprintf(serial_string, "%08x%08x%08x", otp[0], otp[1], otp[2]);
|
||||
sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
|
||||
env_set("serial#", serial_string);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined(CONFIG_WDT) && \
|
||||
(defined(CONFIG_SPL_WATCHDOG_SUPPORT) || !defined(CONFIG_SPL_BUILD))
|
||||
/* Called by macro WATCHDOG_RESET */
|
||||
void watchdog_reset(void)
|
||||
{
|
||||
static ulong next_reset;
|
||||
struct udevice *watchdog_dev;
|
||||
ulong now;
|
||||
|
||||
now = timer_get_us();
|
||||
|
||||
/* Do not reset the watchdog too often, only every 1 sec */
|
||||
if (now > next_reset) {
|
||||
/*
|
||||
* Watchdog has been enabled at SPL stage, to avoid
|
||||
* watchdog_dev bad reference after relocation, we don't save
|
||||
* it in a static variable, we retrieve it each time using
|
||||
* uclass_get_device() call.
|
||||
*/
|
||||
if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev))
|
||||
return;
|
||||
|
||||
wdt_reset(watchdog_dev);
|
||||
next_reset = now + 1000000;
|
||||
}
|
||||
}
|
||||
|
||||
int watchdog_start(void)
|
||||
{
|
||||
struct udevice *watchdog_dev;
|
||||
|
||||
if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
|
||||
debug("Watchdog: Not found by seq!\n");
|
||||
if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
|
||||
puts("Watchdog: Not found!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
wdt_start(watchdog_dev, 0, 0);
|
||||
printf("Watchdog: Started\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int watchdog_start(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int arch_misc_init(void)
|
||||
{
|
||||
watchdog_start();
|
||||
setup_boot_mode();
|
||||
setup_mac_address();
|
||||
setup_serial_number();
|
||||
|
||||
224
arch/arm/mach-stm32mp/fdt.c
Normal file
224
arch/arm/mach-stm32mp/fdt.c
Normal file
@ -0,0 +1,224 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <fdt_support.h>
|
||||
#include <syscon.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#define ETZPC_DECPROT(n) (STM32_ETZPC_BASE + 0x10 + 4 * (n))
|
||||
#define ETZPC_DECPROT_NB 6
|
||||
|
||||
#define DECPROT_MASK 0x03
|
||||
#define NB_PROT_PER_REG 0x10
|
||||
#define DECPROT_NB_BITS 2
|
||||
|
||||
#define DECPROT_SECURED 0x00
|
||||
#define DECPROT_WRITE_SECURE 0x01
|
||||
#define DECPROT_MCU_ISOLATION 0x02
|
||||
#define DECPROT_NON_SECURED 0x03
|
||||
|
||||
#define ETZPC_RESERVED 0xffffffff
|
||||
|
||||
static const u32 stm32mp1_ip_addr[] = {
|
||||
0x5c008000, /* 00 stgenc */
|
||||
0x54000000, /* 01 bkpsram */
|
||||
0x5c003000, /* 02 iwdg1 */
|
||||
0x5c000000, /* 03 usart1 */
|
||||
0x5c001000, /* 04 spi6 */
|
||||
0x5c002000, /* 05 i2c4 */
|
||||
ETZPC_RESERVED, /* 06 reserved */
|
||||
0x54003000, /* 07 rng1 */
|
||||
0x54002000, /* 08 hash1 */
|
||||
0x54001000, /* 09 cryp1 */
|
||||
0x5a003000, /* 0A ddrctrl */
|
||||
0x5a004000, /* 0B ddrphyc */
|
||||
0x5c009000, /* 0C i2c6 */
|
||||
ETZPC_RESERVED, /* 0D reserved */
|
||||
ETZPC_RESERVED, /* 0E reserved */
|
||||
ETZPC_RESERVED, /* 0F reserved */
|
||||
0x40000000, /* 10 tim2 */
|
||||
0x40001000, /* 11 tim3 */
|
||||
0x40002000, /* 12 tim4 */
|
||||
0x40003000, /* 13 tim5 */
|
||||
0x40004000, /* 14 tim6 */
|
||||
0x40005000, /* 15 tim7 */
|
||||
0x40006000, /* 16 tim12 */
|
||||
0x40007000, /* 17 tim13 */
|
||||
0x40008000, /* 18 tim14 */
|
||||
0x40009000, /* 19 lptim1 */
|
||||
0x4000a000, /* 1A wwdg1 */
|
||||
0x4000b000, /* 1B spi2 */
|
||||
0x4000c000, /* 1C spi3 */
|
||||
0x4000d000, /* 1D spdifrx */
|
||||
0x4000e000, /* 1E usart2 */
|
||||
0x4000f000, /* 1F usart3 */
|
||||
0x40010000, /* 20 uart4 */
|
||||
0x40011000, /* 21 uart5 */
|
||||
0x40012000, /* 22 i2c1 */
|
||||
0x40013000, /* 23 i2c2 */
|
||||
0x40014000, /* 24 i2c3 */
|
||||
0x40015000, /* 25 i2c5 */
|
||||
0x40016000, /* 26 cec */
|
||||
0x40017000, /* 27 dac */
|
||||
0x40018000, /* 28 uart7 */
|
||||
0x40019000, /* 29 uart8 */
|
||||
ETZPC_RESERVED, /* 2A reserved */
|
||||
ETZPC_RESERVED, /* 2B reserved */
|
||||
0x4001c000, /* 2C mdios */
|
||||
ETZPC_RESERVED, /* 2D reserved */
|
||||
ETZPC_RESERVED, /* 2E reserved */
|
||||
ETZPC_RESERVED, /* 2F reserved */
|
||||
0x44000000, /* 30 tim1 */
|
||||
0x44001000, /* 31 tim8 */
|
||||
ETZPC_RESERVED, /* 32 reserved */
|
||||
0x44003000, /* 33 usart6 */
|
||||
0x44004000, /* 34 spi1 */
|
||||
0x44005000, /* 35 spi4 */
|
||||
0x44006000, /* 36 tim15 */
|
||||
0x44007000, /* 37 tim16 */
|
||||
0x44008000, /* 38 tim17 */
|
||||
0x44009000, /* 39 spi5 */
|
||||
0x4400a000, /* 3A sai1 */
|
||||
0x4400b000, /* 3B sai2 */
|
||||
0x4400c000, /* 3C sai3 */
|
||||
0x4400d000, /* 3D dfsdm */
|
||||
0x4400e000, /* 3E tt_fdcan */
|
||||
ETZPC_RESERVED, /* 3F reserved */
|
||||
0x50021000, /* 40 lptim2 */
|
||||
0x50022000, /* 41 lptim3 */
|
||||
0x50023000, /* 42 lptim4 */
|
||||
0x50024000, /* 43 lptim5 */
|
||||
0x50027000, /* 44 sai4 */
|
||||
0x50025000, /* 45 vrefbuf */
|
||||
0x4c006000, /* 46 dcmi */
|
||||
0x4c004000, /* 47 crc2 */
|
||||
0x48003000, /* 48 adc */
|
||||
0x4c002000, /* 49 hash2 */
|
||||
0x4c003000, /* 4A rng2 */
|
||||
0x4c005000, /* 4B cryp2 */
|
||||
ETZPC_RESERVED, /* 4C reserved */
|
||||
ETZPC_RESERVED, /* 4D reserved */
|
||||
ETZPC_RESERVED, /* 4E reserved */
|
||||
ETZPC_RESERVED, /* 4F reserved */
|
||||
ETZPC_RESERVED, /* 50 sram1 */
|
||||
ETZPC_RESERVED, /* 51 sram2 */
|
||||
ETZPC_RESERVED, /* 52 sram3 */
|
||||
ETZPC_RESERVED, /* 53 sram4 */
|
||||
ETZPC_RESERVED, /* 54 retram */
|
||||
0x49000000, /* 55 otg */
|
||||
0x48004000, /* 56 sdmmc3 */
|
||||
0x48005000, /* 57 dlybsd3 */
|
||||
0x48000000, /* 58 dma1 */
|
||||
0x48001000, /* 59 dma2 */
|
||||
0x48002000, /* 5A dmamux */
|
||||
0x58002000, /* 5B fmc */
|
||||
0x58003000, /* 5C qspi */
|
||||
0x58004000, /* 5D dlybq */
|
||||
0x5800a000, /* 5E eth */
|
||||
ETZPC_RESERVED, /* 5F reserved */
|
||||
};
|
||||
|
||||
/* fdt helper */
|
||||
static bool fdt_disable_subnode_by_address(void *fdt, int offset, u32 addr)
|
||||
{
|
||||
int node;
|
||||
|
||||
for (node = fdt_first_subnode(fdt, offset);
|
||||
node >= 0;
|
||||
node = fdt_next_subnode(fdt, node)) {
|
||||
if (addr == (u32)fdt_getprop(fdt, node, "reg", 0)) {
|
||||
if (fdtdec_get_is_enabled(fdt, node)) {
|
||||
fdt_status_disabled(fdt, node);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int stm32_fdt_fixup_etzpc(void *fdt)
|
||||
{
|
||||
const u32 *array;
|
||||
int array_size, i;
|
||||
int soc_node, offset, shift;
|
||||
u32 addr, status, decprot[ETZPC_DECPROT_NB];
|
||||
|
||||
array = stm32mp1_ip_addr;
|
||||
array_size = ARRAY_SIZE(stm32mp1_ip_addr);
|
||||
|
||||
for (i = 0; i < ETZPC_DECPROT_NB; i++)
|
||||
decprot[i] = readl(ETZPC_DECPROT(i));
|
||||
|
||||
soc_node = fdt_path_offset(fdt, "/soc");
|
||||
if (soc_node < 0)
|
||||
return soc_node;
|
||||
|
||||
for (i = 0; i < array_size; i++) {
|
||||
offset = i / NB_PROT_PER_REG;
|
||||
shift = (i % NB_PROT_PER_REG) * DECPROT_NB_BITS;
|
||||
status = (decprot[offset] >> shift) & DECPROT_MASK;
|
||||
addr = array[i];
|
||||
|
||||
debug("ETZPC: 0x%08x decprot %d=%d\n", addr, i, status);
|
||||
|
||||
if (addr == ETZPC_RESERVED ||
|
||||
status == DECPROT_NON_SECURED)
|
||||
continue;
|
||||
|
||||
if (fdt_disable_subnode_by_address(fdt, soc_node, addr))
|
||||
printf("ETZPC: 0x%08x node disabled, decprot %d=%d\n",
|
||||
addr, i, status);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called right before the kernel is booted. "blob" is the
|
||||
* device tree that will be passed to the kernel.
|
||||
*/
|
||||
int ft_system_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
int ret = 0;
|
||||
u32 pkg;
|
||||
|
||||
if (CONFIG_IS_ENABLED(STM32_ETZPC)) {
|
||||
ret = stm32_fdt_fixup_etzpc(blob);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (get_cpu_package()) {
|
||||
case PKG_AA_LBGA448:
|
||||
pkg = STM32MP157CAA;
|
||||
break;
|
||||
case PKG_AB_LBGA354:
|
||||
pkg = STM32MP157CAB;
|
||||
break;
|
||||
case PKG_AC_TFBGA361:
|
||||
pkg = STM32MP157CAC;
|
||||
break;
|
||||
case PKG_AD_TFBGA257:
|
||||
pkg = STM32MP157CAD;
|
||||
break;
|
||||
default:
|
||||
pkg = 0;
|
||||
break;
|
||||
}
|
||||
if (pkg) {
|
||||
do_fixup_by_compat_u32(blob, "st,stm32mp157-pinctrl",
|
||||
"st,package", pkg, false);
|
||||
do_fixup_by_compat_u32(blob, "st,stm32mp157-z-pinctrl",
|
||||
"st,package", pkg, false);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -6,6 +6,15 @@
|
||||
#ifndef __MACH_STM32MP_DDR_H_
|
||||
#define __MACH_STM32MP_DDR_H_
|
||||
|
||||
int board_ddr_power_init(void);
|
||||
/* DDR power initializations */
|
||||
enum ddr_type {
|
||||
STM32MP_DDR3,
|
||||
STM32MP_LPDDR2_16,
|
||||
STM32MP_LPDDR2_32,
|
||||
STM32MP_LPDDR3_16,
|
||||
STM32MP_LPDDR3_32,
|
||||
};
|
||||
|
||||
int board_ddr_power_init(enum ddr_type ddr_type);
|
||||
|
||||
#endif
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
#define _STM32_GPIO_H_
|
||||
#include <asm/gpio.h>
|
||||
|
||||
#define STM32_GPIOS_PER_BANK 16
|
||||
|
||||
enum stm32_gpio_port {
|
||||
STM32_GPIO_PORT_A = 0,
|
||||
STM32_GPIO_PORT_B,
|
||||
@ -110,5 +112,9 @@ struct stm32_gpio_regs {
|
||||
|
||||
struct stm32_gpio_priv {
|
||||
struct stm32_gpio_regs *regs;
|
||||
unsigned int gpio_range;
|
||||
};
|
||||
|
||||
int stm32_offset_to_index(struct udevice *dev, unsigned int offset);
|
||||
|
||||
#endif /* _STM32_GPIO_H_ */
|
||||
|
||||
@ -13,13 +13,10 @@
|
||||
#define STM32_RCC_BASE 0x50000000
|
||||
#define STM32_PWR_BASE 0x50001000
|
||||
#define STM32_DBGMCU_BASE 0x50081000
|
||||
#define STM32_BSEC_BASE 0x5C005000
|
||||
#define STM32_TZC_BASE 0x5C006000
|
||||
#define STM32_ETZPC_BASE 0x5C007000
|
||||
#define STM32_TAMP_BASE 0x5C00A000
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART_BASE
|
||||
/* hardcoded value can be only used for DEBUG UART */
|
||||
#define STM32_USART1_BASE 0x5C000000
|
||||
#define STM32_USART2_BASE 0x4000E000
|
||||
#define STM32_USART3_BASE 0x4000F000
|
||||
@ -28,20 +25,28 @@
|
||||
#define STM32_USART6_BASE 0x44003000
|
||||
#define STM32_UART7_BASE 0x40018000
|
||||
#define STM32_UART8_BASE 0x40019000
|
||||
#endif
|
||||
|
||||
#define STM32_SYSRAM_BASE 0x2FFC0000
|
||||
#define STM32_SYSRAM_SIZE SZ_256K
|
||||
|
||||
#define STM32_MCU_SRAM_BASE 0x30000000
|
||||
#define STM32_MCU_SRAM_SIZE (3 * SZ_128K)
|
||||
|
||||
#define STM32_DDR_BASE 0xC0000000
|
||||
#define STM32_DDR_SIZE SZ_1G
|
||||
|
||||
#define STM32_RETRAM_BASE 0x38000000
|
||||
#define STM32_RETRAM_SIZE 0x00010000
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <asm/types.h>
|
||||
|
||||
/* enumerated used to identify the SYSCON driver instance */
|
||||
enum {
|
||||
STM32MP_SYSCON_UNKNOWN,
|
||||
STM32MP_SYSCON_STGEN,
|
||||
STM32MP_SYSCON_PWR,
|
||||
STM32MP_SYSCON_STGEN,
|
||||
STM32MP_SYSCON_SYSCFG,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -87,18 +92,38 @@ enum boot_device {
|
||||
|
||||
/* TAMP registers */
|
||||
#define TAMP_BACKUP_REGISTER(x) (STM32_TAMP_BASE + 0x100 + 4 * x)
|
||||
/* secure access */
|
||||
#define TAMP_BACKUP_MAGIC_NUMBER TAMP_BACKUP_REGISTER(4)
|
||||
#define TAMP_BACKUP_BRANCH_ADDRESS TAMP_BACKUP_REGISTER(5)
|
||||
/* non secure access */
|
||||
#define TAMP_COPRO_RSC_TBL_ADDRESS TAMP_BACKUP_REGISTER(17)
|
||||
#define TAMP_BOOT_CONTEXT TAMP_BACKUP_REGISTER(20)
|
||||
#define TAMP_BOOTCOUNT TAMP_BACKUP_REGISTER(21)
|
||||
|
||||
#define TAMP_BOOT_MODE_MASK GENMASK(15, 8)
|
||||
#define TAMP_BOOT_MODE_SHIFT 8
|
||||
#define TAMP_BOOT_DEVICE_MASK GENMASK(7, 4)
|
||||
#define TAMP_BOOT_INSTANCE_MASK GENMASK(3, 0)
|
||||
#define TAMP_BOOT_FORCED_MASK GENMASK(7, 0)
|
||||
#define TAMP_BOOT_DEBUG_ON BIT(16)
|
||||
|
||||
enum forced_boot_mode {
|
||||
BOOT_NORMAL = 0x00,
|
||||
BOOT_FASTBOOT = 0x01,
|
||||
BOOT_RECOVERY = 0x02,
|
||||
BOOT_STM32PROG = 0x03,
|
||||
BOOT_UMS_MMC0 = 0x10,
|
||||
BOOT_UMS_MMC1 = 0x11,
|
||||
BOOT_UMS_MMC2 = 0x12,
|
||||
};
|
||||
|
||||
/* offset used for BSEC driver: misc_read and misc_write */
|
||||
#define STM32_BSEC_SHADOW_OFFSET 0x0
|
||||
#define STM32_BSEC_SHADOW(id) (STM32_BSEC_SHADOW_OFFSET + (id) * 4)
|
||||
#define STM32_BSEC_OTP_OFFSET 0x80000000
|
||||
#define STM32_BSEC_OTP(id) (STM32_BSEC_OTP_OFFSET + (id) * 4)
|
||||
|
||||
#define BSEC_OTP_BOARD 59
|
||||
|
||||
#endif /* __ASSEMBLY__*/
|
||||
#endif /* _MACH_STM32_H_ */
|
||||
|
||||
75
arch/arm/mach-stm32mp/include/mach/stm32mp1_smc.h
Normal file
75
arch/arm/mach-stm32mp/include/mach/stm32mp1_smc.h
Normal file
@ -0,0 +1,75 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#ifndef __STM32MP1_SMC_H__
|
||||
#define __STM32MP1_SMC_H__
|
||||
|
||||
#include <linux/arm-smccc.h>
|
||||
|
||||
/*
|
||||
* SMC function IDs for STM32 Service queries
|
||||
* STM32 SMC services use the space between 0x82000000 and 0x8200FFFF
|
||||
* like this is defined in SMC calling Convention by ARM
|
||||
* for SiP (silicon Partner)
|
||||
* http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
|
||||
*/
|
||||
#define STM32_SMC_VERSION 0x82000000
|
||||
/* SMC reserved for future ST services */
|
||||
#define STM32_SMC_RESERVED_ST 0x82000001
|
||||
|
||||
/* Secure Service access from Non-secure */
|
||||
#define STM32_SMC_RCC 0x82001000
|
||||
#define STM32_SMC_PWR 0x82001001
|
||||
#define STM32_SMC_RTC 0x82001002
|
||||
#define STM32_SMC_BSEC 0x82001003
|
||||
|
||||
/* Register access service use for RCC/RTC/PWR */
|
||||
#define STM32_SMC_REG_WRITE 0x1
|
||||
#define STM32_SMC_REG_SET 0x2
|
||||
#define STM32_SMC_REG_CLEAR 0x3
|
||||
|
||||
/* Service for BSEC */
|
||||
#define STM32_SMC_READ_SHADOW 0x01
|
||||
#define STM32_SMC_PROG_OTP 0x02
|
||||
#define STM32_SMC_WRITE_SHADOW 0x03
|
||||
#define STM32_SMC_READ_OTP 0x04
|
||||
#define STM32_SMC_READ_ALL 0x05
|
||||
#define STM32_SMC_WRITE_ALL 0x06
|
||||
|
||||
/* SMC error codes */
|
||||
#define STM32_SMC_OK 0x0
|
||||
#define STM32_SMC_NOT_SUPPORTED -1
|
||||
#define STM32_SMC_FAILED -2
|
||||
#define STM32_SMC_INVALID_PARAMS -3
|
||||
|
||||
#define stm32_smc_exec(svc, op, data1, data2) \
|
||||
stm32_smc(svc, op, data1, data2, NULL)
|
||||
|
||||
#ifdef CONFIG_ARM_SMCCC
|
||||
static inline u32 stm32_smc(u32 svc, u8 op, u32 data1, u32 data2, u32 *result)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
|
||||
arm_smccc_smc(svc, op, data1, data2, 0, 0, 0, 0, &res);
|
||||
|
||||
if (res.a0) {
|
||||
pr_err("%s: Failed to exec in secure mode (err = %ld)\n",
|
||||
__func__, res.a0);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (result)
|
||||
*result = (u32)res.a1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline u32 stm32_smc(u32 svc, u8 op, u32 data1, u32 data2, u32 *result)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __STM32MP1_SMC_H__ */
|
||||
@ -3,13 +3,43 @@
|
||||
* Copyright (C) 2015-2017, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#define CPU_STMP32MP15x 0x500
|
||||
/* ID = Device Version (bit31:16) + Device Part Number (RPN) (bit7:0) */
|
||||
#define CPU_STM32MP157Cxx 0x05000000
|
||||
#define CPU_STM32MP157Axx 0x05000001
|
||||
#define CPU_STM32MP153Cxx 0x05000024
|
||||
#define CPU_STM32MP153Axx 0x05000025
|
||||
#define CPU_STM32MP151Cxx 0x0500002E
|
||||
#define CPU_STM32MP151Axx 0x0500002F
|
||||
#define CPU_STM32MP157Fxx 0x05000080
|
||||
#define CPU_STM32MP157Dxx 0x05000081
|
||||
#define CPU_STM32MP153Fxx 0x050000A4
|
||||
#define CPU_STM32MP153Dxx 0x050000A5
|
||||
#define CPU_STM32MP151Fxx 0x050000AE
|
||||
#define CPU_STM32MP151Dxx 0x050000AF
|
||||
|
||||
/* return CPU_STMP32MPxx constants */
|
||||
/* return CPU_STMP32MP...Xxx constants */
|
||||
u32 get_cpu_type(void);
|
||||
|
||||
#define CPU_REVA 0x1000
|
||||
#define CPU_REVB 0x2000
|
||||
#define CPU_REVZ 0x2001
|
||||
|
||||
/* return CPU_REV constants */
|
||||
u32 get_cpu_rev(void);
|
||||
|
||||
/* Get Package options from OTP */
|
||||
u32 get_cpu_package(void);
|
||||
|
||||
#define PKG_AA_LBGA448 4
|
||||
#define PKG_AB_LBGA354 3
|
||||
#define PKG_AC_TFBGA361 2
|
||||
#define PKG_AD_TFBGA257 1
|
||||
|
||||
/* return boot mode */
|
||||
u32 get_bootmode(void);
|
||||
/* start IWDG watchdog */
|
||||
int watchdog_start(void);
|
||||
|
||||
/* board power management : configure vddcore according OPP */
|
||||
void board_vddcore_init(u32 voltage_mv);
|
||||
int board_vddcore_set(void);
|
||||
|
||||
@ -47,14 +47,14 @@ static u32 __secure stm32mp_get_gicd_base_address(void)
|
||||
return (periphbase & CBAR_MASK) + GIC_DIST_OFFSET;
|
||||
}
|
||||
|
||||
static void __secure stm32mp_smp_kick_all_cpus(void)
|
||||
static void __secure stm32mp_raise_sgi0(int cpu)
|
||||
{
|
||||
u32 gic_dist_addr;
|
||||
|
||||
gic_dist_addr = stm32mp_get_gicd_base_address();
|
||||
|
||||
/* kick all CPUs (except this one) by writing to GICD_SGIR */
|
||||
writel(1U << 24, gic_dist_addr + GICD_SGIR);
|
||||
/* ask cpu with SGI0 */
|
||||
writel((BIT(cpu) << 16), gic_dist_addr + GICD_SGIR);
|
||||
}
|
||||
|
||||
void __secure psci_arch_cpu_entry(void)
|
||||
@ -62,6 +62,9 @@ void __secure psci_arch_cpu_entry(void)
|
||||
u32 cpu = psci_get_cpu_id();
|
||||
|
||||
psci_set_state(cpu, PSCI_AFFINITY_LEVEL_ON);
|
||||
|
||||
/* reset magic in TAMP register */
|
||||
writel(0xFFFFFFFF, TAMP_BACKUP_MAGIC_NUMBER);
|
||||
}
|
||||
|
||||
int __secure psci_features(u32 function_id, u32 psci_fid)
|
||||
@ -103,7 +106,13 @@ int __secure psci_affinity_info(u32 function_id, u32 target_affinity,
|
||||
|
||||
int __secure psci_migrate_info_type(u32 function_id)
|
||||
{
|
||||
/* Trusted OS is either not present or does not require migration */
|
||||
/*
|
||||
* in Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf
|
||||
* return 2 = Trusted OS is either not present or does not require
|
||||
* migration, system of this type does not require the caller
|
||||
* to use the MIGRATE function.
|
||||
* MIGRATE function calls return NOT_SUPPORTED.
|
||||
*/
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -121,6 +130,17 @@ int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc,
|
||||
if (psci_state[cpu] == PSCI_AFFINITY_LEVEL_ON)
|
||||
return ARM_PSCI_RET_ALREADY_ON;
|
||||
|
||||
/* reset magic in TAMP register */
|
||||
if (readl(TAMP_BACKUP_MAGIC_NUMBER))
|
||||
writel(0xFFFFFFFF, TAMP_BACKUP_MAGIC_NUMBER);
|
||||
|
||||
/*
|
||||
* ROM code need a first SGI0 after core reset
|
||||
* core is ready when magic is set to 0 in ROM code
|
||||
*/
|
||||
while (readl(TAMP_BACKUP_MAGIC_NUMBER))
|
||||
stm32mp_raise_sgi0(cpu);
|
||||
|
||||
/* store target PC and context id*/
|
||||
psci_save(cpu, pc, context_id);
|
||||
|
||||
@ -136,7 +156,8 @@ int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc,
|
||||
writel(BOOT_API_A7_CORE0_MAGIC_NUMBER,
|
||||
TAMP_BACKUP_MAGIC_NUMBER);
|
||||
|
||||
stm32mp_smp_kick_all_cpus();
|
||||
/* Generate an IT to start the core */
|
||||
stm32mp_raise_sgi0(cpu);
|
||||
|
||||
return ARM_PSCI_RET_SUCCESS;
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include <errno.h>
|
||||
#include <regmap.h>
|
||||
#include <syscon.h>
|
||||
#include <asm/arch/stm32mp1_smc.h>
|
||||
#include <power/pmic.h>
|
||||
#include <power/regulator.h>
|
||||
|
||||
@ -32,13 +33,20 @@ struct stm32mp_pwr_priv {
|
||||
static int stm32mp_pwr_write(struct udevice *dev, uint reg,
|
||||
const uint8_t *buff, int len)
|
||||
{
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
struct stm32mp_pwr_priv *priv = dev_get_priv(dev);
|
||||
#endif
|
||||
u32 val = *(u32 *)buff;
|
||||
|
||||
if (len != 4)
|
||||
return -EINVAL;
|
||||
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
return stm32_smc_exec(STM32_SMC_PWR, STM32_SMC_REG_WRITE,
|
||||
STM32MP_PWR_CR3, val);
|
||||
#else /* CONFIG_STM32MP1_TRUSTED */
|
||||
return regmap_write(priv->regmap, STM32MP_PWR_CR3, val);
|
||||
#endif /* CONFIG_STM32MP1_TRUSTED */
|
||||
}
|
||||
|
||||
static int stm32mp_pwr_read(struct udevice *dev, uint reg, uint8_t *buff,
|
||||
|
||||
@ -7,13 +7,24 @@
|
||||
#include <dm.h>
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <linux/libfdt.h>
|
||||
|
||||
static int spl_board_load_image(struct spl_image_info *spl_image,
|
||||
struct spl_boot_device *bootdev)
|
||||
{
|
||||
/* TODO : add download support in SPL without TF-A */
|
||||
return -1;
|
||||
}
|
||||
|
||||
SPL_LOAD_IMAGE_METHOD("UART", 0, BOOT_DEVICE_UART, spl_board_load_image);
|
||||
SPL_LOAD_IMAGE_METHOD("USB", 0, BOOT_DEVICE_USB, spl_board_load_image);
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
u32 boot_mode;
|
||||
|
||||
boot_mode = (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_MODE_MASK) >>
|
||||
TAMP_BOOT_MODE_SHIFT;
|
||||
boot_mode = get_bootmode();
|
||||
|
||||
switch (boot_mode) {
|
||||
case BOOT_FLASH_SD_1:
|
||||
@ -22,6 +33,21 @@ u32 spl_boot_device(void)
|
||||
case BOOT_FLASH_SD_2:
|
||||
case BOOT_FLASH_EMMC_2:
|
||||
return BOOT_DEVICE_MMC2;
|
||||
case BOOT_SERIAL_UART_1:
|
||||
case BOOT_SERIAL_UART_2:
|
||||
case BOOT_SERIAL_UART_3:
|
||||
case BOOT_SERIAL_UART_4:
|
||||
case BOOT_SERIAL_UART_5:
|
||||
case BOOT_SERIAL_UART_6:
|
||||
case BOOT_SERIAL_UART_7:
|
||||
case BOOT_SERIAL_UART_8:
|
||||
return BOOT_DEVICE_UART;
|
||||
case BOOT_SERIAL_USB_OTG:
|
||||
return BOOT_DEVICE_USB;
|
||||
case BOOT_FLASH_NAND_FMC:
|
||||
return BOOT_DEVICE_NAND;
|
||||
case BOOT_FLASH_NOR_QSPI:
|
||||
return BOOT_DEVICE_SPI;
|
||||
}
|
||||
|
||||
return BOOT_DEVICE_MMC1;
|
||||
@ -44,43 +70,67 @@ int spl_boot_partition(const u32 boot_device)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_DISPLAY_PRINT
|
||||
void spl_display_print(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
const char *model;
|
||||
|
||||
/* same code than show_board_info() but not compiled for SPL
|
||||
* see CONFIG_DISPLAY_BOARDINFO & common/board_info.c
|
||||
*/
|
||||
model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
|
||||
if (model)
|
||||
printf("Model: %s\n", model);
|
||||
}
|
||||
#endif
|
||||
|
||||
__weak int board_vddcore_set(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
int ret, clk, reset, pinctrl, power;
|
||||
|
||||
arch_cpu_init();
|
||||
|
||||
ret = spl_early_init();
|
||||
if (ret) {
|
||||
debug("spl_early_init() failed: %d\n", ret);
|
||||
debug("%s: spl_early_init() failed: %d\n", __func__, ret);
|
||||
hang();
|
||||
}
|
||||
|
||||
ret = uclass_get_device(UCLASS_CLK, 0, &dev);
|
||||
if (ret) {
|
||||
debug("Clock init failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
clk = uclass_get_device(UCLASS_CLK, 0, &dev);
|
||||
if (clk)
|
||||
debug("%s: Clock init failed: %d\n", __func__, clk);
|
||||
|
||||
ret = uclass_get_device(UCLASS_RESET, 0, &dev);
|
||||
if (ret) {
|
||||
debug("Reset init failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
reset = uclass_get_device(UCLASS_RESET, 0, &dev);
|
||||
if (reset)
|
||||
debug("%s: Reset init failed: %d\n", __func__, reset);
|
||||
|
||||
ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
|
||||
if (ret) {
|
||||
debug("%s: Cannot find pinctrl device\n", __func__);
|
||||
return;
|
||||
}
|
||||
pinctrl = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
|
||||
if (pinctrl)
|
||||
debug("%s: Cannot find pinctrl device: %d\n",
|
||||
__func__, pinctrl);
|
||||
|
||||
/* enable console uart printing */
|
||||
preloader_console_init();
|
||||
|
||||
watchdog_start();
|
||||
|
||||
/* change vddcore if needed after clock tree init */
|
||||
power = board_vddcore_set();
|
||||
|
||||
if (clk || reset || pinctrl || power)
|
||||
printf("%s: probe failed clk=%d reset=%d pinctrl=%d power=%d\n",
|
||||
__func__, clk, reset, pinctrl, power);
|
||||
|
||||
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
|
||||
if (ret) {
|
||||
debug("DRAM init failed: %d\n", ret);
|
||||
return;
|
||||
printf("DRAM init failed: %d\n", ret);
|
||||
hang();
|
||||
}
|
||||
}
|
||||
|
||||
139
arch/arm/mach-stm32mp/stm32mp1_helper_dbg.S
Normal file
139
arch/arm/mach-stm32mp/stm32mp1_helper_dbg.S
Normal file
@ -0,0 +1,139 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (c) 2019, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
* This file is only needed for current Soc revision which has a limitation on
|
||||
* debug reset halt. This can be removed when using the Soc revision that
|
||||
* fixes the limitation. Anyway, this source code identifies the Soc revision
|
||||
* and is only executed if it corresponds, so it can be kept on other
|
||||
* revisions without any consequence.
|
||||
* The revisions that need the workaround have ID values:
|
||||
* - 0x2000X500
|
||||
* - 0x2001X500
|
||||
****************************************************************************/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/macro.h>
|
||||
|
||||
#define BIT(nr) (1 << (nr))
|
||||
|
||||
#define BSEC_OTP_DATA0_ADDR 0x5C005200
|
||||
#define BSEC_OTP_DATA0_CLOSED BIT(6)
|
||||
|
||||
#define DBG_DSCR_ADDR 0x500D0088
|
||||
#define DBG_DSCR_HDBGEN BIT(14)
|
||||
|
||||
#define RCC_DBGCFGR_ADDR 0x5000080C
|
||||
#define RCC_DBGCFGR_DBGCKEN BIT(8)
|
||||
|
||||
#define PWR_CR1_ADDR 0x50001000
|
||||
#define PWR_CR1_DBP BIT(8)
|
||||
|
||||
#define DBGMCU_IDC_ADDR 0x50081000
|
||||
#define DBGMCU_IDC_MASK 0xFFFE0FFF
|
||||
#define DBGMCU_IDC_VALUE 0x20000500
|
||||
|
||||
#define TAMP_BKP_REGISTER_20 (0x5C00A100 + (20 << 2))
|
||||
|
||||
|
||||
.globl save_boot_params
|
||||
|
||||
ENTRY(save_boot_params)
|
||||
/*
|
||||
* This function is the first call after reset.
|
||||
* Boot rom parameters are stored in r0..r3, so we mustn't use them
|
||||
* here. And because they are saved in r9..r12 just after the
|
||||
* execution of this function, we should firstly use these registers.
|
||||
* And then, if more registers needed, we have to start by using
|
||||
* r8, and then r7 and so on. By this way, debug will be done in
|
||||
* conditions closed to the initial context.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Check Sec Close bit in OTP (word 0 bit 6). If enabled, do not allow
|
||||
* debug session and exit function.
|
||||
*/
|
||||
ldr r12, =BSEC_OTP_DATA0_ADDR
|
||||
ldr r12, [r12]
|
||||
ands r11, r12, #BSEC_OTP_DATA0_CLOSED
|
||||
bne func_exit
|
||||
|
||||
/* Check Soc revision */
|
||||
ldr r12, =RCC_DBGCFGR_ADDR
|
||||
ldr r11, [r12] /* read RCC_DBGCFGR (r11) */
|
||||
orr r10, r11, #RCC_DBGCFGR_DBGCKEN
|
||||
str r10, [r12] /* update RCC_DBGCFGR */
|
||||
ldr r10, =DBGMCU_IDC_ADDR
|
||||
ldr r10, [r10] /* read DBGMCU_IDC (r10) */
|
||||
str r11, [r12] /* restore RCC_DBGCFGR (r11) */
|
||||
ldr r12, =DBGMCU_IDC_MASK
|
||||
and r10, r12 /* mask reserved bits */
|
||||
ldr r11, =DBGMCU_IDC_VALUE
|
||||
teq r10, r11 /* test DBGMCU_IDC */
|
||||
bne func_exit
|
||||
|
||||
/* Disable the backup domain write protection */
|
||||
ldr r12, =PWR_CR1_ADDR
|
||||
ldr r11, [r12]
|
||||
orr r11, r11, #PWR_CR1_DBP
|
||||
str r11, [r12]
|
||||
poll_dbp:
|
||||
ldr r11, [r12]
|
||||
tst r11, #PWR_CR1_DBP
|
||||
beq poll_dbp
|
||||
|
||||
/* Clear tamper 20 bit 16 if set */
|
||||
ldr r12, =TAMP_BKP_REGISTER_20
|
||||
ldr r11, [r12]
|
||||
tst r11, #(BIT(16))
|
||||
beq func_exit
|
||||
bic r11, #(BIT(16))
|
||||
str r11, [r12]
|
||||
|
||||
/* Re-enable the backup domain write protection */
|
||||
ldr r12, =PWR_CR1_ADDR
|
||||
ldr r11, [r12]
|
||||
bic r11, #PWR_CR1_DBP
|
||||
str r11, [r12]
|
||||
poll_dbp_2:
|
||||
ldr r11, [r12]
|
||||
tst r11, #PWR_CR1_DBP
|
||||
bne poll_dbp_2
|
||||
|
||||
/* Get current time + 1 second */
|
||||
/* CNTFRQ */
|
||||
mrc p15, 0, r12, c14, c0, 0
|
||||
/* CNTPCT_64 */
|
||||
mrrc p15, 0, r11, r10, c14
|
||||
add r12, r12, r11
|
||||
|
||||
loop:
|
||||
/* Check A7 DBG_DSCR HDBGEN bit value */
|
||||
ldr r10, =DBG_DSCR_ADDR
|
||||
ldr r10, [r10]
|
||||
tst r10, #DBG_DSCR_HDBGEN
|
||||
beq loop_continue
|
||||
/* Sw break */
|
||||
bkpt 5
|
||||
/* Jump entrypoint */
|
||||
b reset
|
||||
loop_continue:
|
||||
/* Check 1 second expiration */
|
||||
mrrc p15, 0, r10, r9, c14
|
||||
/* Check if MSB 64-bit increment needed */
|
||||
cmp r12, r11
|
||||
bmi msb_incr
|
||||
cmp r12, r10
|
||||
bmi func_exit
|
||||
b loop
|
||||
msb_incr:
|
||||
cmp r12, r10
|
||||
bpl loop
|
||||
cmp r11, r10
|
||||
bmi loop
|
||||
func_exit:
|
||||
b save_boot_params_ret
|
||||
ENDPROC(save_boot_params)
|
||||
@ -9,10 +9,10 @@
|
||||
#include <asm/arch/stm32.h>
|
||||
|
||||
static const struct udevice_id stm32mp_syscon_ids[] = {
|
||||
{ .compatible = "st,stm32-stgen",
|
||||
.data = STM32MP_SYSCON_STGEN },
|
||||
{ .compatible = "st,stm32mp1-pwr",
|
||||
.data = STM32MP_SYSCON_PWR },
|
||||
{ .compatible = "st,stm32mp1-pwr", .data = STM32MP_SYSCON_PWR },
|
||||
{ .compatible = "st,stm32-stgen", .data = STM32MP_SYSCON_STGEN },
|
||||
{ .compatible = "st,stm32mp157-syscfg",
|
||||
.data = STM32MP_SYSCON_SYSCFG },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@ -712,6 +712,14 @@
|
||||
sandbox_tee {
|
||||
compatible = "sandbox,tee";
|
||||
};
|
||||
|
||||
pinctrl {
|
||||
compatible = "sandbox,pinctrl";
|
||||
};
|
||||
|
||||
hwspinlock@0 {
|
||||
compatible = "sandbox,hwspinlock";
|
||||
};
|
||||
};
|
||||
|
||||
#include "sandbox_pmic.dtsi"
|
||||
|
||||
@ -97,6 +97,7 @@ struct sandbox_state {
|
||||
/* Information about Watchdog */
|
||||
struct sandbox_wdt_info wdt;
|
||||
|
||||
bool hwspinlock; /* Hardware Spinlock status */
|
||||
ulong next_tag; /* Next address tag to allocate */
|
||||
struct list_head mapmem_head; /* struct sandbox_mapmem_entry */
|
||||
};
|
||||
|
||||
@ -9,4 +9,15 @@ config SYS_VENDOR
|
||||
config SYS_CONFIG_NAME
|
||||
default "stm32mp1"
|
||||
|
||||
config CMD_STBOARD
|
||||
bool "stboard - command for OTP board information"
|
||||
default y
|
||||
help
|
||||
This compile the stboard command to
|
||||
read and write the board in the OTP.
|
||||
|
||||
config TARGET_STM32MP157C_DK2
|
||||
bool "support of STMicroelectronics STM32MP157C-DK2 Discovery Board"
|
||||
default y
|
||||
|
||||
endif
|
||||
|
||||
@ -2,7 +2,9 @@ STM32MP1 BOARD
|
||||
M: Patrick Delaunay <patrick.delaunay@st.com>
|
||||
L: uboot-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: board/st/stm32mp1
|
||||
F: include/configs/stm32mp1.h
|
||||
F: configs/stm32mp15_basic_defconfig
|
||||
F: arch/arm/dts/stm32mp157*
|
||||
F: board/st/stm32mp1
|
||||
F: configs/stm32mp15_basic_defconfig
|
||||
F: configs/stm32mp15_optee_defconfig
|
||||
F: configs/stm32mp15_trusted_defconfig
|
||||
F: include/configs/stm32mp1.h
|
||||
|
||||
@ -7,6 +7,7 @@ ifdef CONFIG_SPL_BUILD
|
||||
obj-y += spl.o
|
||||
else
|
||||
obj-y += stm32mp1.o
|
||||
obj-$(CONFIG_CMD_STBOARD) += cmd_stboard.o
|
||||
endif
|
||||
|
||||
obj-y += board.o
|
||||
|
||||
@ -25,17 +25,21 @@ It features:
|
||||
Everything is supported in Linux but U-Boot is limited to:
|
||||
1. UART
|
||||
2. SDCard/MMC controller (SDMMC)
|
||||
3. NAND controller (FMC)
|
||||
4. NOR controller (QSPI)
|
||||
5. USB controller (OTG DWC2)
|
||||
|
||||
And the necessary drivers
|
||||
1. I2C
|
||||
2. STPMU1
|
||||
2. STPMU1 (PMIC and regulator)
|
||||
2. STPMIC1 (PMIC and regulator)
|
||||
3. Clock, Reset, Sysreset
|
||||
4. Fuse
|
||||
|
||||
Currently the following boards are supported:
|
||||
+ stm32mp157c-ev1
|
||||
+ stm32mp157c-ed1
|
||||
+ stm32mp157a-dk1
|
||||
+ stm32mp157c-dk2
|
||||
|
||||
3. Boot Sequences
|
||||
=================
|
||||
@ -45,15 +49,28 @@ BootRom => FSBL in SYSRAM => SSBL in DDR => OS (Linux Kernel)
|
||||
with FSBL = First Stage Bootloader
|
||||
SSBL = Second Stage Bootloader
|
||||
|
||||
One boot configuration is supported:
|
||||
3 boot configurations are supported:
|
||||
|
||||
The "Basic" boot chain (defconfig_file : stm32mp15_basic_defconfig)
|
||||
1) The "Trusted" boot chain (defconfig_file : stm32mp15_trusted_defconfig)
|
||||
BootRom => FSBL = Trusted Firmware-A (TF-A) => SSBL = U-Boot
|
||||
TF-A performs a full initialization of Secure peripherals and installs a
|
||||
secure monitor.
|
||||
U-Boot is running in normal world and uses TF-A monitor
|
||||
to access to secure resources.
|
||||
|
||||
2) The "Trusted & OP-TEE" boot chain (defconfig_file : stm32mp15_optee_defconfig)
|
||||
BootRom => FSBL = Trusted Firmware-A (TF-A) => SSBL = U-Boot
|
||||
TF-A performs a full initialization of Secure peripherals and installs OP-TEE
|
||||
from specific partitions (teeh, teed, teex).
|
||||
U-Boot is running in normal world and uses OP-TEE monitor to access.
|
||||
|
||||
3) The "Basic" boot chain (defconfig_file : stm32mp15_basic_defconfig)
|
||||
BootRom => FSBL = U-Boot SPL => SSBL = U-Boot
|
||||
SPL has limited security initialisation
|
||||
U-Boot is running in secure mode and provide a secure monitor to the kernel
|
||||
with only PSCI support (Power State Coordination Interface defined by ARM)
|
||||
with only PSCI support (Power State Coordination Interface defined by ARM).
|
||||
|
||||
All the STM32MP1 board supported by U-Boot use the same generic board
|
||||
All the STM32MP1 boards supported by U-Boot use the same generic board
|
||||
stm32mp1 which support all the bootable devices.
|
||||
|
||||
Each board is configurated only with the associated device tree.
|
||||
@ -64,12 +81,18 @@ Each board is configurated only with the associated device tree.
|
||||
You need to select the appropriate device tree for your board,
|
||||
the supported device trees for stm32mp157 are:
|
||||
|
||||
+ ev1: eval board with pmic stpmu1 (ev1 = mother board + daughter ed1)
|
||||
+ ev1: eval board with pmic stpmic1 (ev1 = mother board + daughter ed1)
|
||||
dts: stm32mp157c-ev1
|
||||
|
||||
+ ed1: daughter board with pmic stpmu1
|
||||
+ ed1: daughter board with pmic stpmic1
|
||||
dts: stm32mp157c-ed1
|
||||
|
||||
+ dk1: Discovery board
|
||||
dts: stm32mp157a-dk1
|
||||
|
||||
+ dk2: Discovery board = dk1 with a BT/WiFI combo and a DSI panel
|
||||
dts: stm32mp157c-dk2
|
||||
|
||||
5. Build Procedure
|
||||
==================
|
||||
|
||||
@ -90,29 +113,40 @@ the supported device trees for stm32mp157 are:
|
||||
# export KBUILD_OUTPUT=/path/to/output
|
||||
|
||||
for example: use one output directory for each configuration
|
||||
# export KBUILD_OUTPUT=stm32mp15_trusted
|
||||
# export KBUILD_OUTPUT=stm32mp15_optee
|
||||
# export KBUILD_OUTPUT=stm32mp15_basic
|
||||
|
||||
4. Configure the U-Boot:
|
||||
you can build outside of code directory:
|
||||
# export KBUILD_OUTPUT=../build/stm32mp15_trusted
|
||||
|
||||
4. Configure U-Boot:
|
||||
|
||||
# make <defconfig_file>
|
||||
|
||||
- For trusted boot mode : "stm32mp15_trusted_defconfig"
|
||||
- For trusted & optee boot mode : "stm32mp15_optee_defconfig"
|
||||
- For basic boot mode: "stm32mp15_basic_defconfig"
|
||||
|
||||
5. Configure the device-tree and build the U-Boot image:
|
||||
|
||||
# make DEVICE_TREE=<name> all
|
||||
|
||||
|
||||
example:
|
||||
basic boot on ev1
|
||||
# export KBUILD_OUTPUT=stm32mp15_basic
|
||||
# make stm32mp15_basic_defconfig
|
||||
a) trusted boot on ev1
|
||||
# export KBUILD_OUTPUT=stm32mp15_trusted
|
||||
# make stm32mp15_trusted_defconfig
|
||||
# make DEVICE_TREE=stm32mp157c-ev1 all
|
||||
|
||||
basic boot on ed1
|
||||
b) trusted & OP-TEE boot on dk1
|
||||
# export KBUILD_OUTPUT=stm32mp15_optee
|
||||
# make stm32mp15_optee_defconfig
|
||||
# make DEVICE_TREE=stm32mp157a-dk1 all
|
||||
|
||||
c) basic boot on dk2
|
||||
# export KBUILD_OUTPUT=stm32mp15_basic
|
||||
# make stm32mp15_basic_defconfig
|
||||
# make DEVICE_TREE=stm32mp157c-ed1 all
|
||||
# make DEVICE_TREE=stm32mp157c-dk2 all
|
||||
|
||||
6. Output files
|
||||
|
||||
@ -122,26 +156,42 @@ the supported device trees for stm32mp157 are:
|
||||
So in the output directory (selected by KBUILD_OUTPUT),
|
||||
you can found the needed files:
|
||||
|
||||
a) For Trusted boot (with or without OP-TEE)
|
||||
+ FSBL = tf-a.stm32 (provided by TF-A compilation)
|
||||
+ SSBL = u-boot.stm32
|
||||
|
||||
b) For Basic boot
|
||||
+ FSBL = spl/u-boot-spl.stm32
|
||||
+ SSBL = u-boot.img
|
||||
|
||||
6. Switch Setting for Boot Mode
|
||||
===============================
|
||||
|
||||
You can select the boot mode, on the board ed1 with the switch SW1
|
||||
You can select the boot mode,
|
||||
- on the daugther board ed1 with the switch SW1 : BOOT0, BOOT1, BOOT2
|
||||
- on board DK1/DK2 with the switch SW1 (BOOT1 forced to 0)
|
||||
|
||||
-----------------------------------
|
||||
Boot Mode BOOT2 BOOT1 BOOT0
|
||||
-----------------------------------
|
||||
Reserved 0 0 0
|
||||
NOR 0 0 1
|
||||
SD-Card 1 1 1
|
||||
SD-Card 1 0 1
|
||||
eMMC 0 1 0
|
||||
NAND 0 1 1
|
||||
Recovery 1 1 0
|
||||
Recovery 0 0 0
|
||||
|
||||
- on board DK1/DK2 with the switch SW1 : BOOT0, BOOT2
|
||||
(BOOT1 forced to 0, NOR not supported)
|
||||
|
||||
--------------------------
|
||||
Boot Mode BOOT2 BOOT0
|
||||
--------------------------
|
||||
Reserved 1 0
|
||||
SD-Card 1 1
|
||||
Recovery 0 0
|
||||
|
||||
Recovery is a boot from serial link (UART/USB) and it is used with
|
||||
STM32CubeProgrammer tool to load executable in RAM and to update the flash
|
||||
devices available on the board (NOR/NAND/eMMC/SDCARD).
|
||||
@ -158,14 +208,14 @@ The minimal requirements for STMP32MP1 boot up to U-Boot are:
|
||||
- one ssbl partition for U-Boot
|
||||
|
||||
Then the minimal GPT partition is:
|
||||
----- ------- --------- -------------
|
||||
| Num | Name | Size | Content |
|
||||
----- ------- -------- --------------
|
||||
| 1 | fsbl1 | 256 KiB | TF-A or SPL |
|
||||
| 2 | fsbl2 | 256 KiB | TF-A or SPL |
|
||||
| 3 | ssbl | enought | U-Boot |
|
||||
| * | - | - | Boot/Rootfs|
|
||||
----- ------- --------- -------------
|
||||
----- ------- --------- --------------
|
||||
| Num | Name | Size | Content |
|
||||
----- ------- --------- --------------
|
||||
| 1 | fsbl1 | 256 KiB | TF-A or SPL |
|
||||
| 2 | fsbl2 | 256 KiB | TF-A or SPL |
|
||||
| 3 | ssbl | enought | U-Boot |
|
||||
| * | - | - | Boot/Rootfs |
|
||||
----- ------- --------- --------------
|
||||
|
||||
(*) add bootable partition for extlinux.conf
|
||||
following Generic Distribution
|
||||
@ -189,7 +239,7 @@ for example: with gpt table with 128 entries
|
||||
|
||||
you can add other partitions for kernel
|
||||
one partition rootfs for example:
|
||||
-n 3:5154: -c 4:rootfs
|
||||
-n 4:5154: -c 4:rootfs \
|
||||
|
||||
c) copy the FSBL (2 times) and SSBL file on the correct partition.
|
||||
in this example in partition 1 to 3
|
||||
@ -199,7 +249,12 @@ for example: with gpt table with 128 entries
|
||||
# dd if=u-boot-spl.stm32 of=/dev/mmcblk0p2
|
||||
# dd if=u-boot.img of=/dev/mmcblk0p3
|
||||
|
||||
To boot from SDCard, select BootPinMode = 1 1 1 and reset.
|
||||
for trusted boot mode :
|
||||
# dd if=tf-a.stm32 of=/dev/mmcblk0p1
|
||||
# dd if=tf-a.stm32 of=/dev/mmcblk0p2
|
||||
# dd if=u-boot.stm32 of=/dev/mmcblk0p3
|
||||
|
||||
To boot from SDCard, select BootPinMode = 1 0 1 and reset.
|
||||
|
||||
8. Prepare eMMC
|
||||
===============
|
||||
@ -208,7 +263,7 @@ You can use U-Boot to copy binary in eMMC.
|
||||
In the next example, you need to boot from SDCARD and the images (u-boot-spl.stm32, u-boot.img)
|
||||
are presents on SDCARD (mmc 0) in ext4 partition 4 (bootfs).
|
||||
|
||||
To boot from SDCard, select BootPinMode = 1 1 1 and reset.
|
||||
To boot from SDCard, select BootPinMode = 1 0 1 and reset.
|
||||
|
||||
Then you update the eMMC with the next U-Boot command :
|
||||
|
||||
@ -250,7 +305,20 @@ Mac id storage and retrieval in stm32mp otp :
|
||||
To program a MAC address on virgin OTP words above, you can use the fuse command
|
||||
on bank 0 to access to internal OTP:
|
||||
|
||||
example to set mac address "12:34:56:78:9a:bc"
|
||||
Prerequisite: check if a MAC address isn't yet programmed in OTP
|
||||
|
||||
1- check OTP: their value must be equal to 0
|
||||
|
||||
STM32MP> fuse sense 0 57 2
|
||||
Sensing bank 0:
|
||||
Word 0x00000039: 00000000 00000000
|
||||
|
||||
2- check environment variable
|
||||
|
||||
STM32MP> env print ethaddr
|
||||
## Error: "ethaddr" not defined
|
||||
|
||||
Example to set mac address "12:34:56:78:9a:bc"
|
||||
|
||||
1- Write OTP
|
||||
STM32MP> fuse prog -y 0 57 0x78563412 0x0000bc9a
|
||||
@ -264,5 +332,43 @@ on bank 0 to access to internal OTP:
|
||||
### Setting environment from OTP MAC address = "12:34:56:78:9a:bc"
|
||||
|
||||
4 check env update
|
||||
STM32MP> print ethaddr
|
||||
STM32MP> env print ethaddr
|
||||
ethaddr=12:34:56:78:9a:bc
|
||||
|
||||
warning:: This MAC address provisioning can't be executed twice on the same
|
||||
board as the OTP are protected. It is already done for the board
|
||||
provided by STMicroelectronics.
|
||||
|
||||
10. Coprocessor firmware
|
||||
========================
|
||||
|
||||
U-Boot can boot the coprocessor before the kernel (coprocessor early boot).
|
||||
|
||||
A/ Manuallly by using rproc commands (update the bootcmd)
|
||||
Configurations
|
||||
# env set name_copro "stm32mp15_m4.elf"
|
||||
# env set dev_copro 0
|
||||
# env set loadaddr_copro 0xC1000000
|
||||
|
||||
Load binary from bootfs partition (number 4) on SDCard (mmc 0)
|
||||
# ext4load mmc 0:4 ${loadaddr_copro} ${name_copro}
|
||||
=> ${filesize} updated with the size of the loaded file
|
||||
|
||||
Start M4 firmware with remote proc command
|
||||
# rproc init
|
||||
# rproc load ${dev_copro} ${loadaddr_copro} ${filesize}
|
||||
# rproc load_rsc ${dev_copro} ${loadaddr_copro} ${filesize}
|
||||
# rproc start ${dev_copro}
|
||||
|
||||
B/ Automatically by using FIT feature and generic DISTRO bootcmd
|
||||
|
||||
see examples in this directory :
|
||||
|
||||
Generate FIT including kernel + device tree + M4 firmware
|
||||
with cfg with M4 boot
|
||||
$> mkimage -f fit_copro_kernel_dtb.its fit_copro_kernel_dtb.itb
|
||||
|
||||
Then using DISTRO configuration file: see extlinux.conf to select
|
||||
the correct configuration
|
||||
=> stm32mp157c-ev1-m4
|
||||
=> stm32mp157c-dk2-m4
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/ddr.h>
|
||||
#include <power/pmic.h>
|
||||
#include <power/stpmu1.h>
|
||||
#include <power/stpmic1.h>
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||
void board_debug_uart_init(void)
|
||||
@ -37,64 +37,189 @@ void board_debug_uart_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PMIC_STPMU1
|
||||
int board_ddr_power_init(void)
|
||||
#ifdef CONFIG_PMIC_STPMIC1
|
||||
u32 opp_voltage_mv;
|
||||
|
||||
void board_vddcore_init(u32 voltage_mv)
|
||||
{
|
||||
opp_voltage_mv = voltage_mv;
|
||||
}
|
||||
|
||||
int board_vddcore_set(void)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
u32 value;
|
||||
|
||||
if (!opp_voltage_mv)
|
||||
return 0;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_PMIC,
|
||||
DM_GET_DRIVER(pmic_stpmu1), &dev);
|
||||
DM_GET_DRIVER(pmic_stpmic1), &dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* VDDCORE= STMPCI1 BUCK1 ramp=+25mV, 5 => 725mV, 36 => 1500mV */
|
||||
value = ((opp_voltage_mv - 725) / 25) + 5;
|
||||
if (value < 5)
|
||||
value = 5;
|
||||
if (value > 36)
|
||||
value = 36;
|
||||
|
||||
return pmic_clrsetbits(dev,
|
||||
STPMIC1_BUCKX_MAIN_CR(STPMIC1_BUCK1),
|
||||
STPMIC1_BUCK_VOUT_MASK,
|
||||
STPMIC1_BUCK_VOUT(value));
|
||||
}
|
||||
|
||||
int board_ddr_power_init(enum ddr_type ddr_type)
|
||||
{
|
||||
struct udevice *dev;
|
||||
bool buck3_at_1800000v = false;
|
||||
int ret;
|
||||
u32 buck2;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_PMIC,
|
||||
DM_GET_DRIVER(pmic_stpmic1), &dev);
|
||||
if (ret)
|
||||
/* No PMIC on board */
|
||||
return 0;
|
||||
|
||||
/* Set LDO3 to sync mode */
|
||||
ret = pmic_reg_read(dev, STPMU1_LDOX_CTRL_REG(STPMU1_LDO3));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
switch (ddr_type) {
|
||||
case STM32MP_DDR3:
|
||||
/* VTT = Set LDO3 to sync mode */
|
||||
ret = pmic_reg_read(dev, STPMIC1_LDOX_MAIN_CR(STPMIC1_LDO3));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret &= ~STPMU1_LDO3_MODE;
|
||||
ret &= ~STPMU1_LDO12356_OUTPUT_MASK;
|
||||
ret |= STPMU1_LDO3_DDR_SEL << STPMU1_LDO12356_OUTPUT_SHIFT;
|
||||
ret &= ~STPMIC1_LDO3_MODE;
|
||||
ret &= ~STPMIC1_LDO12356_VOUT_MASK;
|
||||
ret |= STPMIC1_LDO_VOUT(STPMIC1_LDO3_DDR_SEL);
|
||||
|
||||
ret = pmic_reg_write(dev, STPMU1_LDOX_CTRL_REG(STPMU1_LDO3),
|
||||
ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = pmic_reg_write(dev, STPMIC1_LDOX_MAIN_CR(STPMIC1_LDO3),
|
||||
ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Set BUCK2 to 1.35V */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMU1_BUCKX_CTRL_REG(STPMU1_BUCK2),
|
||||
STPMU1_BUCK_OUTPUT_MASK,
|
||||
STPMU1_BUCK2_1350000V);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* VDD_DDR = Set BUCK2 to 1.35V */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMIC1_BUCKX_MAIN_CR(STPMIC1_BUCK2),
|
||||
STPMIC1_BUCK_VOUT_MASK,
|
||||
STPMIC1_BUCK2_1350000V);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Enable BUCK2 and VREF */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMU1_BUCKX_CTRL_REG(STPMU1_BUCK2),
|
||||
STPMU1_BUCK_EN, STPMU1_BUCK_EN);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Enable VDD_DDR = BUCK2 */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMIC1_BUCKX_MAIN_CR(STPMIC1_BUCK2),
|
||||
STPMIC1_BUCK_ENA, STPMIC1_BUCK_ENA);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mdelay(STPMU1_DEFAULT_START_UP_DELAY_MS);
|
||||
mdelay(STPMIC1_DEFAULT_START_UP_DELAY_MS);
|
||||
|
||||
ret = pmic_clrsetbits(dev, STPMU1_VREF_CTRL_REG,
|
||||
STPMU1_VREF_EN, STPMU1_VREF_EN);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Enable VREF */
|
||||
ret = pmic_clrsetbits(dev, STPMIC1_REFDDR_MAIN_CR,
|
||||
STPMIC1_VREF_ENA, STPMIC1_VREF_ENA);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mdelay(STPMU1_DEFAULT_START_UP_DELAY_MS);
|
||||
mdelay(STPMIC1_DEFAULT_START_UP_DELAY_MS);
|
||||
|
||||
/* Enable LDO3 */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMU1_LDOX_CTRL_REG(STPMU1_LDO3),
|
||||
STPMU1_LDO_EN, STPMU1_LDO_EN);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Enable VTT = LDO3 */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMIC1_LDOX_MAIN_CR(STPMIC1_LDO3),
|
||||
STPMIC1_LDO_ENA, STPMIC1_LDO_ENA);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mdelay(STPMU1_DEFAULT_START_UP_DELAY_MS);
|
||||
mdelay(STPMIC1_DEFAULT_START_UP_DELAY_MS);
|
||||
|
||||
break;
|
||||
|
||||
case STM32MP_LPDDR2_16:
|
||||
case STM32MP_LPDDR2_32:
|
||||
case STM32MP_LPDDR3_16:
|
||||
case STM32MP_LPDDR3_32:
|
||||
/*
|
||||
* configure VDD_DDR1 = LDO3
|
||||
* Set LDO3 to 1.8V
|
||||
* + bypass mode if BUCK3 = 1.8V
|
||||
* + normal mode if BUCK3 != 1.8V
|
||||
*/
|
||||
ret = pmic_reg_read(dev,
|
||||
STPMIC1_BUCKX_MAIN_CR(STPMIC1_BUCK3));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret & STPMIC1_BUCK3_1800000V) == STPMIC1_BUCK3_1800000V)
|
||||
buck3_at_1800000v = true;
|
||||
|
||||
ret = pmic_reg_read(dev, STPMIC1_LDOX_MAIN_CR(STPMIC1_LDO3));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret &= ~STPMIC1_LDO3_MODE;
|
||||
ret &= ~STPMIC1_LDO12356_VOUT_MASK;
|
||||
ret |= STPMIC1_LDO3_1800000;
|
||||
if (buck3_at_1800000v)
|
||||
ret |= STPMIC1_LDO3_MODE;
|
||||
|
||||
ret = pmic_reg_write(dev, STPMIC1_LDOX_MAIN_CR(STPMIC1_LDO3),
|
||||
ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* VDD_DDR2 : Set BUCK2 to 1.2V (16bits) or 1.25V (32 bits)*/
|
||||
switch (ddr_type) {
|
||||
case STM32MP_LPDDR2_32:
|
||||
case STM32MP_LPDDR3_32:
|
||||
buck2 = STPMIC1_BUCK2_1250000V;
|
||||
break;
|
||||
default:
|
||||
case STM32MP_LPDDR2_16:
|
||||
case STM32MP_LPDDR3_16:
|
||||
buck2 = STPMIC1_BUCK2_1200000V;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMIC1_BUCKX_MAIN_CR(STPMIC1_BUCK2),
|
||||
STPMIC1_BUCK_VOUT_MASK,
|
||||
buck2);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Enable VDD_DDR1 = LDO3 */
|
||||
ret = pmic_clrsetbits(dev, STPMIC1_LDOX_MAIN_CR(STPMIC1_LDO3),
|
||||
STPMIC1_LDO_ENA, STPMIC1_LDO_ENA);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mdelay(STPMIC1_DEFAULT_START_UP_DELAY_MS);
|
||||
|
||||
/* Enable VDD_DDR2 =BUCK2 */
|
||||
ret = pmic_clrsetbits(dev,
|
||||
STPMIC1_BUCKX_MAIN_CR(STPMIC1_BUCK2),
|
||||
STPMIC1_BUCK_ENA, STPMIC1_BUCK_ENA);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mdelay(STPMIC1_DEFAULT_START_UP_DELAY_MS);
|
||||
|
||||
/* Enable VREF */
|
||||
ret = pmic_clrsetbits(dev, STPMIC1_REFDDR_MAIN_CR,
|
||||
STPMIC1_VREF_ENA, STPMIC1_VREF_ENA);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
mdelay(STPMIC1_DEFAULT_START_UP_DELAY_MS);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
145
board/st/stm32mp1/cmd_stboard.c
Normal file
145
board/st/stm32mp1/cmd_stboard.c
Normal file
@ -0,0 +1,145 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <misc.h>
|
||||
#include <dm/device.h>
|
||||
#include <dm/uclass.h>
|
||||
|
||||
static bool check_stboard(u16 board)
|
||||
{
|
||||
unsigned int i;
|
||||
const u16 st_board_id[] = {
|
||||
0x1272,
|
||||
0x1263,
|
||||
0x1264,
|
||||
0x1298,
|
||||
0x1341,
|
||||
0x1497,
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(st_board_id); i++)
|
||||
if (board == st_board_id[i])
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void display_stboard(u32 otp)
|
||||
{
|
||||
printf("Board: MB%04x Var%d Rev.%c-%02d\n",
|
||||
otp >> 16,
|
||||
(otp >> 12) & 0xF,
|
||||
((otp >> 8) & 0xF) - 1 + 'A',
|
||||
otp & 0xF);
|
||||
}
|
||||
|
||||
static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
int ret;
|
||||
u32 otp;
|
||||
u8 revision;
|
||||
unsigned long board, variant, bom;
|
||||
struct udevice *dev;
|
||||
int confirmed = argc == 6 && !strcmp(argv[1], "-y");
|
||||
|
||||
argc -= 1 + confirmed;
|
||||
argv += 1 + confirmed;
|
||||
|
||||
if (argc != 0 && argc != 4)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
|
||||
ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
|
||||
&otp, sizeof(otp));
|
||||
|
||||
if (ret) {
|
||||
puts("OTP read error");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
if (argc == 0) {
|
||||
if (!otp)
|
||||
puts("Board : OTP board FREE\n");
|
||||
else
|
||||
display_stboard(otp);
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
if (otp) {
|
||||
display_stboard(otp);
|
||||
printf("ERROR: OTP board not FREE\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(argv[0], 16, &board) < 0 ||
|
||||
board == 0 || board > 0xFFFF) {
|
||||
printf("argument %d invalid: %s\n", 1, argv[0]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(argv[1], 10, &variant) < 0 ||
|
||||
variant == 0 || variant > 15) {
|
||||
printf("argument %d invalid: %s\n", 2, argv[1]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
revision = argv[2][0] - 'A' + 1;
|
||||
if (strlen(argv[2]) > 1 || revision == 0 || revision > 15) {
|
||||
printf("argument %d invalid: %s\n", 3, argv[2]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(argv[3], 10, &bom) < 0 ||
|
||||
bom == 0 || bom > 15) {
|
||||
printf("argument %d invalid: %s\n", 4, argv[3]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
otp = (board << 16) | (variant << 12) | (revision << 8) | bom;
|
||||
display_stboard(otp);
|
||||
printf("=> OTP[%d] = %08X\n", BSEC_OTP_BOARD, otp);
|
||||
|
||||
if (!check_stboard((u16)board)) {
|
||||
printf("Unknown board MB%04x\n", (u16)board);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
if (!confirmed) {
|
||||
printf("Warning: Programming BOARD in OTP is irreversible!\n");
|
||||
printf("Really perform this OTP programming? <y/N>\n");
|
||||
|
||||
if (!confirm_yesno()) {
|
||||
puts("BOARD programming aborted\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
ret = misc_write(dev, STM32_BSEC_OTP(BSEC_OTP_BOARD),
|
||||
&otp, sizeof(otp));
|
||||
|
||||
if (ret) {
|
||||
puts("BOARD programming error\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
puts("BOARD programming done\n");
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(stboard, 6, 0, do_stboard,
|
||||
"read/write board reference in OTP",
|
||||
"\n"
|
||||
" Print current board information\n"
|
||||
"stboard [-y] <Board> <Variant> <Revision> <BOM>\n"
|
||||
" Write board information\n"
|
||||
" - Board: xxxx, example 1264 for MB1264\n"
|
||||
" - Variant: 1 ... 15\n"
|
||||
" - Revision: A...O\n"
|
||||
" - BOM: 1...15\n");
|
||||
20
board/st/stm32mp1/extlinux.conf
Normal file
20
board/st/stm32mp1/extlinux.conf
Normal file
@ -0,0 +1,20 @@
|
||||
# Generic Distro Configuration for STM32MP157
|
||||
menu title Select the boot mode
|
||||
TIMEOUT 20
|
||||
DEFAULT stm32mp157c-ev1
|
||||
|
||||
LABEL stm32mp157c-ev1
|
||||
KERNEL /fit_kernel_dtb.itb#ev1
|
||||
APPEND root=/dev/mmcblk0p6 rootwait rw earlyprintk console=ttyS3,115200
|
||||
|
||||
LABEL stm32mp157c-ev1-m4
|
||||
KERNEL /fit_copro_kernel_dtb.itb#ev1-m4
|
||||
APPEND root=/dev/mmcblk0p6 rootwait rw earlyprintk console=ttyS3,115200
|
||||
|
||||
LABEL stm32mp157c-dk2
|
||||
KERNEL /fit_kernel_dtb.itb#dk2
|
||||
APPEND root=/dev/mmcblk0p6 rootwait rw earlyprintk console=ttyS3,115200
|
||||
|
||||
LABEL stm32mp157c-dk2-m4
|
||||
KERNEL /fit_copro_kernel_dtb.itb#dk2-m4
|
||||
APPEND root=/dev/mmcblk0p6 rootwait rw earlyprintk console=ttyS3,115200
|
||||
103
board/st/stm32mp1/fit_copro_kernel_dtb.its
Normal file
103
board/st/stm32mp1/fit_copro_kernel_dtb.its
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Compilation:
|
||||
* mkimage -f fit_copro_kernel_dtb.its fit_copro_kernel_dtb.itb
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/ {
|
||||
description = "U-Boot fitImage for stm32mp157";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
|
||||
copro {
|
||||
description = "M4 copro";
|
||||
data = /incbin/("stm32mp15_m4.elf");
|
||||
type = "stm32copro";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
load = <0xC0800000>;
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
kernel {
|
||||
description = "Linux kernel";
|
||||
data = /incbin/("zImage");
|
||||
type = "kernel";
|
||||
arch = "arm";
|
||||
os = "linux";
|
||||
compression = "none";
|
||||
load = <0xC0008000>;
|
||||
entry = <0xC0008000>;
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
fdt-dk2 {
|
||||
description = "FDT dk2";
|
||||
data = /incbin/("stm32mp157c-dk2.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
fdt-ev1 {
|
||||
description = "FDT ev1";
|
||||
data = /incbin/("stm32mp157c-ev1.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "dk2-m4";
|
||||
|
||||
dk2-m4 {
|
||||
description = "dk2-m4";
|
||||
loadables = "copro";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-dk2";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
dk2 {
|
||||
description = "dk2";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-dk2";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
ev1-m4 {
|
||||
description = "ev1-m4";
|
||||
loadables = "copro";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-ev1";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
ev1 {
|
||||
description = "ev1";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-ev1";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
82
board/st/stm32mp1/fit_kernel_dtb.its
Normal file
82
board/st/stm32mp1/fit_kernel_dtb.its
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Compilation:
|
||||
* mkimage -f fit_kernel_dtb.its fit_kernel_dtb.itb
|
||||
*
|
||||
* Files in linux build dir:
|
||||
* - arch/arm/boot/zImage
|
||||
* - arch/arm/boot/dts/stm32mp157c-dk2.dtb
|
||||
* - arch/arm/boot/dts/stm32mp157c-ev1.dtb
|
||||
*
|
||||
* load mmc 0:4 $kernel_addr_r fit_kernel_dtb.itb
|
||||
* bootm $kernel_addr_r
|
||||
* bootm $kernel_addr_r#dk2
|
||||
* bootm $kernel_addr_r#ev1
|
||||
*
|
||||
* or use extlinux.conf in this directory
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/ {
|
||||
description = "U-Boot fitImage for stm32mp157";
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
kernel {
|
||||
description = "Linux kernel";
|
||||
data = /incbin/("zImage");
|
||||
type = "kernel";
|
||||
arch = "arm";
|
||||
os = "linux";
|
||||
compression = "none";
|
||||
load = <0xC0008000>;
|
||||
entry = <0xC0008000>;
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
fdt-dk2 {
|
||||
description = "FDT dk2";
|
||||
data = /incbin/("stm32mp157c-dk2.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
fdt-ev1 {
|
||||
description = "FDT ev1";
|
||||
data = /incbin/("stm32mp157c-ev1.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "dk2";
|
||||
|
||||
dk2 {
|
||||
description = "dk2";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-dk2";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
|
||||
ev1 {
|
||||
description = "ev1";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-ev1";
|
||||
hash-1 {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -9,24 +9,37 @@
|
||||
#include <dm.h>
|
||||
#include <ram.h>
|
||||
#include <asm/io.h>
|
||||
#include <post.h>
|
||||
#include <power/pmic.h>
|
||||
#include <power/stpmu1.h>
|
||||
#include <power/stpmic1.h>
|
||||
#include <asm/arch/ddr.h>
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
/* Keep vdd on during the reset cycle */
|
||||
#if defined(CONFIG_PMIC_STPMU1) && defined(CONFIG_SPL_POWER_SUPPORT)
|
||||
#if defined(CONFIG_PMIC_STPMIC1) && defined(CONFIG_SPL_POWER_SUPPORT)
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_PMIC,
|
||||
DM_GET_DRIVER(pmic_stpmu1), &dev);
|
||||
DM_GET_DRIVER(pmic_stpmic1), &dev);
|
||||
if (!ret)
|
||||
pmic_clrsetbits(dev,
|
||||
STPMU1_MASK_RESET_BUCK,
|
||||
STPMU1_MASK_RESET_BUCK3,
|
||||
STPMU1_MASK_RESET_BUCK3);
|
||||
STPMIC1_BUCKS_MRST_CR,
|
||||
STPMIC1_MRST_BUCK(STPMIC1_BUCK3),
|
||||
STPMIC1_MRST_BUCK(STPMIC1_BUCK3));
|
||||
|
||||
/* Check if debug is enabled to program PMIC according to the bit */
|
||||
if ((readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_DEBUG_ON) && !ret) {
|
||||
printf("Keep debug unit ON\n");
|
||||
|
||||
pmic_clrsetbits(dev, STPMIC1_BUCKS_MRST_CR,
|
||||
STPMIC1_MRST_BUCK_DEBUG,
|
||||
STPMIC1_MRST_BUCK_DEBUG);
|
||||
|
||||
if (STPMIC1_MRST_LDO_DEBUG)
|
||||
pmic_clrsetbits(dev, STPMIC1_LDOS_MRST_CR,
|
||||
STPMIC1_MRST_LDO_DEBUG,
|
||||
STPMIC1_MRST_LDO_DEBUG);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -953,6 +953,14 @@ config CMD_PCMCIA
|
||||
about 1990. These devices are typically removable memory or network
|
||||
cards using a standard 68-pin connector.
|
||||
|
||||
config CMD_PINMUX
|
||||
bool "pinmux - show pins muxing"
|
||||
default y if PINCTRL
|
||||
help
|
||||
Parse all available pin-controllers and show pins muxing. This
|
||||
is useful for debug purpoer to check the pin muxing and to know if
|
||||
a pin is configured as a GPIO or as an alternate function.
|
||||
|
||||
config CMD_POWEROFF
|
||||
bool "poweroff"
|
||||
help
|
||||
|
||||
@ -103,6 +103,7 @@ ifdef CONFIG_PCI
|
||||
obj-$(CONFIG_CMD_PCI) += pci.o
|
||||
endif
|
||||
obj-y += pcmcia.o
|
||||
obj-$(CONFIG_CMD_PINMUX) += pinmux.o
|
||||
obj-$(CONFIG_CMD_PXE) += pxe.o
|
||||
obj-$(CONFIG_CMD_WOL) += wol.o
|
||||
obj-$(CONFIG_CMD_QFW) += qfw.o
|
||||
|
||||
70
cmd/adc.c
70
cmd/adc.c
@ -35,7 +35,7 @@ static int do_adc_info(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
unsigned int data_mask;
|
||||
unsigned int data_mask, ch_mask;
|
||||
int ret, vss, vdd;
|
||||
|
||||
if (argc < 2)
|
||||
@ -49,6 +49,10 @@ static int do_adc_info(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
|
||||
printf("ADC Device '%s' :\n", argv[1]);
|
||||
|
||||
ret = adc_channel_mask(dev, &ch_mask);
|
||||
if (!ret)
|
||||
printf("channel mask: %x\n", ch_mask);
|
||||
|
||||
ret = adc_data_mask(dev, &data_mask);
|
||||
if (!ret)
|
||||
printf("data mask: %x\n", data_mask);
|
||||
@ -67,8 +71,9 @@ static int do_adc_info(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
static int do_adc_single(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
unsigned int data;
|
||||
int ret;
|
||||
int ret, uV;
|
||||
|
||||
if (argc < 3)
|
||||
return CMD_RET_USAGE;
|
||||
@ -81,7 +86,62 @@ static int do_adc_single(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
printf("%u\n", data);
|
||||
ret = uclass_get_device_by_name(UCLASS_ADC, argv[1], &dev);
|
||||
if (!ret && !adc_raw_to_uV(dev, data, &uV))
|
||||
printf("%u, %d uV\n", data, uV);
|
||||
else
|
||||
printf("%u\n", data);
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static int do_adc_scan(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct adc_channel ch[ADC_MAX_CHANNEL];
|
||||
struct udevice *dev;
|
||||
unsigned int ch_mask;
|
||||
int i, chan, ret, uV;
|
||||
|
||||
if (argc < 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
ret = uclass_get_device_by_name(UCLASS_ADC, argv[1], &dev);
|
||||
if (ret) {
|
||||
pr_err("Can't get the ADC %s: %d\n", argv[1], ret);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
switch (argc) {
|
||||
case 3:
|
||||
ch_mask = simple_strtoul(argv[2], NULL, 0);
|
||||
if (ch_mask)
|
||||
break;
|
||||
case 2:
|
||||
ret = adc_channel_mask(dev, &ch_mask);
|
||||
if (ret) {
|
||||
pr_err("Can't get mask for %s: %d\n", dev->name, ret);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ret = adc_channels_single_shot(dev->name, ch_mask, ch);
|
||||
if (ret) {
|
||||
pr_err("Can't get single shot for %s (chans mask: 0x%x): %d\n",
|
||||
dev->name, ch_mask, ret);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
for (chan = 0, i = 0; chan < ADC_MAX_CHANNEL; chan++) {
|
||||
if (!(ch_mask & ADC_CHANNEL(chan)))
|
||||
continue;
|
||||
if (!adc_raw_to_uV(dev, ch[i].data, &uV))
|
||||
printf("[%02d]: %u, %d uV\n", ch[i].id, ch[i].data, uV);
|
||||
else
|
||||
printf("[%02d]: %u\n", ch[i].id, ch[i].data);
|
||||
i++;
|
||||
}
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
@ -90,6 +150,7 @@ static cmd_tbl_t cmd_adc_sub[] = {
|
||||
U_BOOT_CMD_MKENT(list, 1, 1, do_adc_list, "", ""),
|
||||
U_BOOT_CMD_MKENT(info, 2, 1, do_adc_info, "", ""),
|
||||
U_BOOT_CMD_MKENT(single, 3, 1, do_adc_single, "", ""),
|
||||
U_BOOT_CMD_MKENT(scan, 3, 1, do_adc_scan, "", ""),
|
||||
};
|
||||
|
||||
static int do_adc(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
@ -115,6 +176,7 @@ static int do_adc(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
static char adc_help_text[] =
|
||||
"list - list ADC devices\n"
|
||||
"adc info <name> - Get ADC device info\n"
|
||||
"adc single <name> <channel> - Get Single data of ADC device channel";
|
||||
"adc single <name> <channel> - Get Single data of ADC device channel\n"
|
||||
"adc scan <name> [channel mask] - Scan all [or masked] ADC channels";
|
||||
|
||||
U_BOOT_CMD(adc, 4, 1, do_adc, "ADC sub-system", adc_help_text);
|
||||
|
||||
18
cmd/bmp.c
18
cmd/bmp.c
@ -124,8 +124,14 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
|
||||
break;
|
||||
case 4:
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
x = simple_strtoul(argv[2], NULL, 10);
|
||||
y = simple_strtoul(argv[3], NULL, 10);
|
||||
if (!strcmp(argv[2], "m"))
|
||||
x = BMP_ALIGN_CENTER;
|
||||
else
|
||||
x = simple_strtoul(argv[2], NULL, 10);
|
||||
if (!strcmp(argv[3], "m"))
|
||||
y = BMP_ALIGN_CENTER;
|
||||
else
|
||||
y = simple_strtoul(argv[3], NULL, 10);
|
||||
break;
|
||||
default:
|
||||
return CMD_RET_USAGE;
|
||||
@ -249,9 +255,11 @@ int bmp_display(ulong addr, int x, int y)
|
||||
if (!ret) {
|
||||
bool align = false;
|
||||
|
||||
# ifdef CONFIG_SPLASH_SCREEN_ALIGN
|
||||
align = true;
|
||||
# endif /* CONFIG_SPLASH_SCREEN_ALIGN */
|
||||
if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) ||
|
||||
x == BMP_ALIGN_CENTER ||
|
||||
y == BMP_ALIGN_CENTER)
|
||||
align = true;
|
||||
|
||||
ret = video_bmp_display(dev, addr, x, y, align);
|
||||
}
|
||||
#elif defined(CONFIG_LCD)
|
||||
|
||||
@ -190,13 +190,13 @@ static efi_status_t copy_fdt(ulong *fdt_addrp, ulong *fdt_sizep)
|
||||
/* Safe fdt location is at 127MB */
|
||||
new_fdt_addr = fdt_ram_start + (127 * 1024 * 1024) + fdt_size;
|
||||
ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
|
||||
EFI_RUNTIME_SERVICES_DATA, fdt_pages,
|
||||
EFI_BOOT_SERVICES_DATA, fdt_pages,
|
||||
&new_fdt_addr);
|
||||
if (ret != EFI_SUCCESS) {
|
||||
/* If we can't put it there, put it somewhere */
|
||||
new_fdt_addr = (ulong)memalign(EFI_PAGE_SIZE, fdt_size);
|
||||
ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
|
||||
EFI_RUNTIME_SERVICES_DATA, fdt_pages,
|
||||
EFI_BOOT_SERVICES_DATA, fdt_pages,
|
||||
&new_fdt_addr);
|
||||
if (ret != EFI_SUCCESS) {
|
||||
printf("ERROR: Failed to reserve space for FDT\n");
|
||||
@ -625,7 +625,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
|
||||
|
||||
part = blk_get_device_part_str(dev, devnr, &desc, &fs_partition,
|
||||
1);
|
||||
if (part < 0)
|
||||
if (part < 0 || !desc)
|
||||
return;
|
||||
|
||||
bootefi_device_path = efi_dp_from_part(desc, part);
|
||||
|
||||
50
cmd/dtimg.c
50
cmd/dtimg.c
@ -98,10 +98,52 @@ static int do_dtimg_size(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
return dtimg_get_fdt(argc, argv, CMD_DTIMG_SIZE);
|
||||
}
|
||||
|
||||
static int do_dtimg_getindex(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
char *endp;
|
||||
ulong hdr_addr;
|
||||
int index;
|
||||
char buf[512] = { 0 };
|
||||
|
||||
if (argc < 4)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
hdr_addr = simple_strtoul(argv[1], &endp, 16);
|
||||
if (*endp != '\0') {
|
||||
printf("Error: Wrong image address\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
if (!android_dt_check_header(hdr_addr)) {
|
||||
printf("Error: DT image header is incorrect\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
index = android_dt_get_index(hdr_addr, strtoul(argv[2], NULL, 0),
|
||||
strtoul(argv[3], NULL, 0));
|
||||
|
||||
if (index < 0) {
|
||||
printf("Error: board id %04lx not found in DT table\n",
|
||||
strtoul(argv[2], NULL, 0));
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%i", index);
|
||||
|
||||
if (argc == 5)
|
||||
env_set(argv[4], buf);
|
||||
else
|
||||
printf("%s\n", buf);
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static cmd_tbl_t cmd_dtimg_sub[] = {
|
||||
U_BOOT_CMD_MKENT(dump, 2, 0, do_dtimg_dump, "", ""),
|
||||
U_BOOT_CMD_MKENT(start, 4, 0, do_dtimg_start, "", ""),
|
||||
U_BOOT_CMD_MKENT(size, 4, 0, do_dtimg_size, "", ""),
|
||||
U_BOOT_CMD_MKENT(getindex, 5, 0, do_dtimg_getindex, "", ""),
|
||||
};
|
||||
|
||||
static int do_dtimg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
@ -137,5 +179,11 @@ U_BOOT_CMD(
|
||||
" - get size (hex, bytes) of FDT in the image, by index\n"
|
||||
" <addr>: image address in RAM, in hex\n"
|
||||
" <index>: index of desired FDT in the image\n"
|
||||
" <varname>: name of variable where to store size of FDT"
|
||||
" <varname>: name of variable where to store size of FDT\n"
|
||||
"dtimg getindex <addr> <board_id> <board_rev> [varname]\n"
|
||||
" - get index of FDT in the image, by board identifier and revision\n"
|
||||
" <addr>: image address in RAM, in hex\n"
|
||||
" <board_id>: board identifier\n"
|
||||
" <board_rev>: board revision (0 if not used)\n"
|
||||
" [varname]: name of variable where to store index of FDT"
|
||||
);
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <fastboot.h>
|
||||
#include <net.h>
|
||||
#include <usb.h>
|
||||
#include <watchdog.h>
|
||||
|
||||
static int do_fastboot_udp(int argc, char *const argv[],
|
||||
uintptr_t buf_addr, size_t buf_size)
|
||||
@ -74,6 +75,7 @@ static int do_fastboot_usb(int argc, char *const argv[],
|
||||
break;
|
||||
if (ctrlc())
|
||||
break;
|
||||
WATCHDOG_RESET();
|
||||
usb_gadget_handle_interrupts(controller_index);
|
||||
}
|
||||
|
||||
|
||||
36
cmd/nvedit.c
36
cmd/nvedit.c
@ -39,18 +39,24 @@
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if !defined(CONFIG_ENV_IS_IN_EEPROM) && \
|
||||
!defined(CONFIG_ENV_IS_IN_FLASH) && \
|
||||
!defined(CONFIG_ENV_IS_IN_MMC) && \
|
||||
!defined(CONFIG_ENV_IS_IN_FAT) && \
|
||||
!defined(CONFIG_ENV_IS_IN_EXT4) && \
|
||||
!defined(CONFIG_ENV_IS_IN_NAND) && \
|
||||
!defined(CONFIG_ENV_IS_IN_NVRAM) && \
|
||||
!defined(CONFIG_ENV_IS_IN_ONENAND) && \
|
||||
!defined(CONFIG_ENV_IS_IN_SATA) && \
|
||||
!defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \
|
||||
!defined(CONFIG_ENV_IS_IN_REMOTE) && \
|
||||
!defined(CONFIG_ENV_IS_IN_UBI) && \
|
||||
#if defined(CONFIG_ENV_IS_IN_EEPROM) || \
|
||||
defined(CONFIG_ENV_IS_IN_FLASH) || \
|
||||
defined(CONFIG_ENV_IS_IN_MMC) || \
|
||||
defined(CONFIG_ENV_IS_IN_FAT) || \
|
||||
defined(CONFIG_ENV_IS_IN_EXT4) || \
|
||||
defined(CONFIG_ENV_IS_IN_NAND) || \
|
||||
defined(CONFIG_ENV_IS_IN_NVRAM) || \
|
||||
defined(CONFIG_ENV_IS_IN_ONENAND) || \
|
||||
defined(CONFIG_ENV_IS_IN_SATA) || \
|
||||
defined(CONFIG_ENV_IS_IN_SPI_FLASH) || \
|
||||
defined(CONFIG_ENV_IS_IN_REMOTE) || \
|
||||
defined(CONFIG_ENV_IS_IN_UBI)
|
||||
|
||||
#define ENV_IS_IN_DEVICE
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(ENV_IS_IN_DEVICE) && \
|
||||
!defined(CONFIG_ENV_IS_NOWHERE)
|
||||
# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
|
||||
NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
|
||||
@ -738,7 +744,7 @@ ulong env_get_ulong(const char *name, int base, ulong default_val)
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
@ -1194,7 +1200,7 @@ static cmd_tbl_t cmd_env_sub[] = {
|
||||
#if defined(CONFIG_CMD_RUN)
|
||||
U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
U_BOOT_CMD_MKENT(save, 1, 0, do_env_save, "", ""),
|
||||
#endif
|
||||
U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""),
|
||||
@ -1266,7 +1272,7 @@ static char env_help_text[] =
|
||||
#if defined(CONFIG_CMD_RUN)
|
||||
"env run var [...] - run commands in an environment variable\n"
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
"env save - save environment\n"
|
||||
#endif
|
||||
"env set [-f] name [arg ...]\n";
|
||||
|
||||
16
cmd/part.c
16
cmd/part.c
@ -24,6 +24,7 @@
|
||||
enum cmd_part_info {
|
||||
CMD_PART_INFO_START = 0,
|
||||
CMD_PART_INFO_SIZE,
|
||||
CMD_PART_INFO_NB,
|
||||
};
|
||||
|
||||
static int do_part_uuid(int argc, char * const argv[])
|
||||
@ -149,6 +150,9 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param)
|
||||
case CMD_PART_INFO_SIZE:
|
||||
snprintf(buf, sizeof(buf), LBAF, info.size);
|
||||
break;
|
||||
case CMD_PART_INFO_NB:
|
||||
snprintf(buf, sizeof(buf), "%i", part);
|
||||
break;
|
||||
default:
|
||||
printf("** Unknown cmd_part_info value: %d\n", param);
|
||||
return 1;
|
||||
@ -172,6 +176,11 @@ static int do_part_size(int argc, char * const argv[])
|
||||
return do_part_info(argc, argv, CMD_PART_INFO_SIZE);
|
||||
}
|
||||
|
||||
static int do_part_nb(int argc, char * const argv[])
|
||||
{
|
||||
return do_part_info(argc, argv, CMD_PART_INFO_NB);
|
||||
}
|
||||
|
||||
static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
@ -185,6 +194,8 @@ static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
return do_part_start(argc - 2, argv + 2);
|
||||
else if (!strcmp(argv[1], "size"))
|
||||
return do_part_size(argc - 2, argv + 2);
|
||||
else if (!strcmp(argv[1], "nb"))
|
||||
return do_part_nb(argc - 2, argv + 2);
|
||||
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
@ -206,5 +217,8 @@ U_BOOT_CMD(
|
||||
" part can be either partition number or partition name\n"
|
||||
"part size <interface> <dev> <part> <varname>\n"
|
||||
" - set environment variable to the size of the partition (in blocks)\n"
|
||||
" part can be either partition number or partition name"
|
||||
" part can be either partition number or partition name\n"
|
||||
"part nb <interface> <dev> <part> <varname>\n"
|
||||
" - set environment variable to the number of the partition\n"
|
||||
" part shall be the partition name"
|
||||
);
|
||||
|
||||
147
cmd/pinmux.c
Normal file
147
cmd/pinmux.c
Normal file
@ -0,0 +1,147 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <dm.h>
|
||||
#include <errno.h>
|
||||
#include <dm/pinctrl.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
|
||||
#define LIMIT_DEVNAME 30
|
||||
|
||||
static struct udevice *currdev;
|
||||
|
||||
static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
const char *name;
|
||||
int ret;
|
||||
|
||||
switch (argc) {
|
||||
case 2:
|
||||
name = argv[1];
|
||||
ret = uclass_get_device_by_name(UCLASS_PINCTRL, name, &currdev);
|
||||
if (ret) {
|
||||
printf("Can't get the pin-controller: %s!\n", name);
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
/* fall through */
|
||||
case 1:
|
||||
if (!currdev) {
|
||||
printf("Pin-controller device is not set!\n");
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
printf("dev: %s\n", currdev->name);
|
||||
}
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static int show_pinmux(struct udevice *dev)
|
||||
{
|
||||
char pin_name[PINNAME_SIZE];
|
||||
char pin_mux[PINMUX_SIZE];
|
||||
int pins_count;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
pins_count = pinctrl_get_pins_count(dev);
|
||||
|
||||
if (pins_count == -ENOSYS) {
|
||||
printf("Ops get_pins_count not supported\n");
|
||||
return pins_count;
|
||||
}
|
||||
|
||||
for (i = 0; i < pins_count; i++) {
|
||||
ret = pinctrl_get_pin_name(dev, i, pin_name, PINNAME_SIZE);
|
||||
if (ret == -ENOSYS) {
|
||||
printf("Ops get_pin_name not supported\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = pinctrl_get_pin_muxing(dev, i, pin_mux, PINMUX_SIZE);
|
||||
if (ret) {
|
||||
printf("Ops get_pin_muxing error (%d)\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
printf("%-*s: %-*s\n", PINNAME_SIZE, pin_name,
|
||||
PINMUX_SIZE, pin_mux);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret = CMD_RET_USAGE;
|
||||
|
||||
if (currdev && (argc < 2 || strcmp(argv[1], "-a")))
|
||||
return show_pinmux(currdev);
|
||||
|
||||
if (argc < 2 || strcmp(argv[1], "-a"))
|
||||
return ret;
|
||||
|
||||
uclass_foreach_dev_probe(UCLASS_PINCTRL, dev) {
|
||||
/* insert a separator between each pin-controller display */
|
||||
printf("--------------------------\n");
|
||||
printf("%s:\n", dev->name);
|
||||
ret = show_pinmux(dev);
|
||||
if (ret < 0)
|
||||
printf("Can't display pin muxing for %s\n",
|
||||
dev->name);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
struct udevice *dev;
|
||||
|
||||
printf("| %-*.*s| %-*.*s| %s\n",
|
||||
LIMIT_DEVNAME, LIMIT_DEVNAME, "Device",
|
||||
LIMIT_DEVNAME, LIMIT_DEVNAME, "Driver",
|
||||
"Parent");
|
||||
|
||||
uclass_foreach_dev_probe(UCLASS_PINCTRL, dev) {
|
||||
printf("| %-*.*s| %-*.*s| %s\n",
|
||||
LIMIT_DEVNAME, LIMIT_DEVNAME, dev->name,
|
||||
LIMIT_DEVNAME, LIMIT_DEVNAME, dev->driver->name,
|
||||
dev->parent->name);
|
||||
}
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
static cmd_tbl_t pinmux_subcmd[] = {
|
||||
U_BOOT_CMD_MKENT(dev, 2, 1, do_dev, "", ""),
|
||||
U_BOOT_CMD_MKENT(list, 1, 1, do_list, "", ""),
|
||||
U_BOOT_CMD_MKENT(status, 2, 1, do_status, "", ""),
|
||||
};
|
||||
|
||||
static int do_pinmux(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
cmd_tbl_t *cmd;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
cmd = find_cmd_tbl(argv[0], pinmux_subcmd, ARRAY_SIZE(pinmux_subcmd));
|
||||
if (!cmd || argc > cmd->maxargs)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
return cmd->cmd(cmdtp, flag, argc, argv);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(pinmux, CONFIG_SYS_MAXARGS, 1, do_pinmux,
|
||||
"show pin-controller muxing",
|
||||
"list - list UCLASS_PINCTRL devices\n"
|
||||
"pinmux dev [pincontroller-name] - select pin-controller device\n"
|
||||
"pinmux status [-a] - print pin-controller muxing [for all]\n"
|
||||
)
|
||||
24
cmd/pxe.c
24
cmd/pxe.c
@ -8,11 +8,13 @@
|
||||
#include <command.h>
|
||||
#include <malloc.h>
|
||||
#include <mapmem.h>
|
||||
#include <lcd.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <errno.h>
|
||||
#include <linux/list.h>
|
||||
#include <fs.h>
|
||||
#include <splash.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include "menu.h"
|
||||
@ -488,6 +490,7 @@ struct pxe_label {
|
||||
*
|
||||
* title - the name of the menu as given by a 'menu title' line.
|
||||
* default_label - the name of the default label, if any.
|
||||
* bmp - the bmp file name which is displayed in background
|
||||
* timeout - time in tenths of a second to wait for a user key-press before
|
||||
* booting the default label.
|
||||
* prompt - if 0, don't prompt for a choice unless the timeout period is
|
||||
@ -498,6 +501,7 @@ struct pxe_label {
|
||||
struct pxe_menu {
|
||||
char *title;
|
||||
char *default_label;
|
||||
char *bmp;
|
||||
int timeout;
|
||||
int prompt;
|
||||
struct list_head labels;
|
||||
@ -850,6 +854,7 @@ enum token_type {
|
||||
T_FDTDIR,
|
||||
T_ONTIMEOUT,
|
||||
T_IPAPPEND,
|
||||
T_BACKGROUND,
|
||||
T_INVALID
|
||||
};
|
||||
|
||||
@ -883,6 +888,7 @@ static const struct token keywords[] = {
|
||||
{"fdtdir", T_FDTDIR},
|
||||
{"ontimeout", T_ONTIMEOUT,},
|
||||
{"ipappend", T_IPAPPEND,},
|
||||
{"background", T_BACKGROUND,},
|
||||
{NULL, T_INVALID}
|
||||
};
|
||||
|
||||
@ -1160,6 +1166,10 @@ static int parse_menu(cmd_tbl_t *cmdtp, char **c, struct pxe_menu *cfg,
|
||||
nest_level + 1);
|
||||
break;
|
||||
|
||||
case T_BACKGROUND:
|
||||
err = parse_sliteral(c, &cfg->bmp);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Ignoring malformed menu command: %.*s\n",
|
||||
(int)(*c - s), s);
|
||||
@ -1574,6 +1584,20 @@ static void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
|
||||
struct menu *m;
|
||||
int err;
|
||||
|
||||
#ifdef CONFIG_CMD_BMP
|
||||
/* display BMP if available */
|
||||
if (cfg->bmp) {
|
||||
if (get_relfile(cmdtp, cfg->bmp, load_addr)) {
|
||||
run_command("cls", 0);
|
||||
bmp_display(load_addr,
|
||||
BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
|
||||
} else {
|
||||
printf("Skipping background bmp %s for failure\n",
|
||||
cfg->bmp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m = pxe_menu_to_menu(cfg);
|
||||
if (!m)
|
||||
return;
|
||||
|
||||
@ -103,7 +103,7 @@ static int do_remoteproc_list(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
}
|
||||
|
||||
/**
|
||||
* do_remoteproc_load() - Load a remote processor with binary image
|
||||
* do_remoteproc_load() - Load a remote processor with binary or elf image
|
||||
* @cmdtp: unused
|
||||
* @flag: unused
|
||||
* @argc: argument count for the load function
|
||||
@ -142,6 +142,49 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
return ret ? CMD_RET_FAILURE : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* do_remoteproc_load_rsc_table() - Get resource table from an elf image
|
||||
* @cmdtp: unused
|
||||
* @flag: unused
|
||||
* @argc: argument count for the load function
|
||||
* @argv: arguments for the load function
|
||||
*
|
||||
* Return: 0 if no error, else returns appropriate error value.
|
||||
*/
|
||||
static int do_remoteproc_load_rsc_table(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
ulong addr, size, rsc_addr;
|
||||
unsigned int rsc_size;
|
||||
int id, ret;
|
||||
|
||||
if (argc != 4)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
id = (int)simple_strtoul(argv[1], NULL, 3);
|
||||
addr = simple_strtoul(argv[2], NULL, 16);
|
||||
|
||||
size = simple_strtoul(argv[3], NULL, 16);
|
||||
|
||||
if (!size) {
|
||||
printf("\t Expect some size??\n");
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (!rproc_is_initialized()) {
|
||||
printf("\tRemote Processors are not initialized\n");
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
ret = rproc_load_rsc_table(id, addr, size, &rsc_addr, &rsc_size);
|
||||
|
||||
printf("Remote Processor %d resource table %s : 0x%08lx-0x%x\n",
|
||||
id, ret ? "Not found" : "Found", ret ? 0 : rsc_addr,
|
||||
ret ? 0 : rsc_size);
|
||||
|
||||
return ret ? CMD_RET_FAILURE : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* do_remoteproc_wrapper() - wrapper for various rproc commands
|
||||
* @cmdtp: unused
|
||||
@ -172,6 +215,9 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
|
||||
if (!strcmp(argv[0], "start")) {
|
||||
ret = rproc_start(id);
|
||||
if (!ret)
|
||||
env_set("copro_state", "booted");
|
||||
|
||||
} else if (!strcmp(argv[0], "stop")) {
|
||||
ret = rproc_stop(id);
|
||||
} else if (!strcmp(argv[0], "reset")) {
|
||||
@ -213,6 +259,12 @@ static cmd_tbl_t cmd_remoteproc_sub[] = {
|
||||
"- id: ID of the remote processor(see 'list' cmd)\n"
|
||||
"- addr: Address in memory of the image to loadup\n"
|
||||
"- size: Size of the image to loadup\n"),
|
||||
U_BOOT_CMD_MKENT(load_rsc, 5, 1, do_remoteproc_load_rsc_table,
|
||||
"Load resource table address from remote processor provided image",
|
||||
"<id> [addr] [size]\n"
|
||||
"- id: ID of the remote processor(see 'list' cmd)\n"
|
||||
"- addr: Address in memory of the image\n"
|
||||
"- size: Size of the image\n"),
|
||||
U_BOOT_CMD_MKENT(start, 1, 1, do_remoteproc_wrapper,
|
||||
"Start remote processor",
|
||||
"id - ID of the remote processor (see 'list' cmd)\n"),
|
||||
@ -272,8 +324,10 @@ U_BOOT_CMD(rproc, 5, 1, do_remoteproc,
|
||||
"\n\tSubcommands:\n"
|
||||
"\tinit - Enumerate and initalize the remote processors\n"
|
||||
"\tlist - list available remote processors\n"
|
||||
"\tload <id> [addr] [size]- Load the remote processor with binary\n"
|
||||
"\tload <id> [addr] [size]- Load the remote processor with\n"
|
||||
"\t image stored at address [addr] in memory\n"
|
||||
"\tload_rsc <id> [addr] [size]- Load resource table from remote\n"
|
||||
"\t processor provided image at address [addr]\n"
|
||||
"\tstart <id> - Start the remote processor(must be loaded)\n"
|
||||
"\tstop <id> - Stop the remote processor\n"
|
||||
"\treset <id> - Reset the remote processor\n"
|
||||
|
||||
3
cmd/sf.c
3
cmd/sf.c
@ -81,14 +81,13 @@ static int do_spi_flash_probe(int argc, char * const argv[])
|
||||
{
|
||||
unsigned int bus = CONFIG_SF_DEFAULT_BUS;
|
||||
unsigned int cs = CONFIG_SF_DEFAULT_CS;
|
||||
/* In DM mode, defaults speed and mode will be taken from DT */
|
||||
unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
|
||||
unsigned int mode = CONFIG_SF_DEFAULT_MODE;
|
||||
char *endp;
|
||||
#ifdef CONFIG_DM_SPI_FLASH
|
||||
struct udevice *new, *bus_dev;
|
||||
int ret;
|
||||
/* In DM mode defaults will be taken from DT */
|
||||
speed = 0, mode = 0;
|
||||
#else
|
||||
struct spi_flash *new;
|
||||
#endif
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <part.h>
|
||||
#include <usb.h>
|
||||
#include <usb_mass_storage.h>
|
||||
#include <watchdog.h>
|
||||
|
||||
static int ums_read_sector(struct ums *ums_dev,
|
||||
ulong start, lbaint_t blkcnt, void *buf)
|
||||
@ -226,6 +227,8 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
|
||||
rc = CMD_RET_SUCCESS;
|
||||
goto cleanup_register;
|
||||
}
|
||||
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
|
||||
cleanup_register:
|
||||
|
||||
@ -116,6 +116,7 @@ endif
|
||||
|
||||
obj-y += cli.o
|
||||
obj-$(CONFIG_FSL_DDR_INTERACTIVE) += cli_simple.o cli_readline.o
|
||||
obj-$(CONFIG_STM32MP1_DDR_INTERACTIVE) += cli_simple.o cli_readline.o
|
||||
obj-$(CONFIG_DFU_OVER_USB) += dfu.o
|
||||
obj-y += command.o
|
||||
obj-$(CONFIG_$(SPL_)LOG) += log.o
|
||||
|
||||
@ -434,7 +434,6 @@ static int reserve_uboot(void)
|
||||
debug("Reserving %ldk for U-Boot at: %08lx\n",
|
||||
gd->mon_len >> 10, gd->relocaddr);
|
||||
}
|
||||
|
||||
gd->start_addr_sp = gd->relocaddr;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -13,6 +13,12 @@
|
||||
#include <cli.h>
|
||||
#include <watchdog.h>
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
#undef CONFIG_CMDLINE_EDITING
|
||||
#undef CONFIG_AUTO_COMPLETE
|
||||
#undef CONFIG_SHOW_ACTIVITY
|
||||
#endif
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static const char erase_seq[] = "\b \b"; /* erase sequence */
|
||||
|
||||
@ -463,6 +463,11 @@ static void print_pre_console_buffer(int flushpoint)
|
||||
char buf_out[CONFIG_PRE_CON_BUF_SZ + 1];
|
||||
char *buf_in;
|
||||
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (gd->flags & GD_FLG_SILENT)
|
||||
return;
|
||||
#endif
|
||||
|
||||
buf_in = map_sysmem(CONFIG_PRE_CON_BUF_ADDR, CONFIG_PRE_CON_BUF_SZ);
|
||||
if (gd->precon_buf_idx > CONFIG_PRE_CON_BUF_SZ)
|
||||
in = gd->precon_buf_idx - CONFIG_PRE_CON_BUF_SZ;
|
||||
@ -511,8 +516,11 @@ void putc(const char c)
|
||||
membuff_putbyte(&gd->console_out, c);
|
||||
#endif
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (gd->flags & GD_FLG_SILENT)
|
||||
if (gd->flags & GD_FLG_SILENT) {
|
||||
if (!(gd->flags & GD_FLG_DEVINIT))
|
||||
pre_console_putc(c);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISABLE_CONSOLE
|
||||
@ -552,8 +560,11 @@ void puts(const char *s)
|
||||
membuff_put(&gd->console_out, s, strlen(s));
|
||||
#endif
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (gd->flags & GD_FLG_SILENT)
|
||||
if (gd->flags & GD_FLG_SILENT) {
|
||||
if (!(gd->flags & GD_FLG_DEVINIT))
|
||||
pre_console_puts(s);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISABLE_CONSOLE
|
||||
@ -713,14 +724,22 @@ int console_assign(int file, const char *devname)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void console_update_silent(void)
|
||||
/* return true if the 'silent' flag is removed */
|
||||
static bool console_update_silent(void)
|
||||
{
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (env_get("silent") != NULL)
|
||||
if (env_get("silent") != NULL) {
|
||||
gd->flags |= GD_FLG_SILENT;
|
||||
else
|
||||
} else {
|
||||
unsigned long flags = gd->flags;
|
||||
|
||||
gd->flags &= ~GD_FLG_SILENT;
|
||||
|
||||
return !!(flags & GD_FLG_SILENT);
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int console_announce_r(void)
|
||||
@ -785,6 +804,13 @@ int console_init_r(void)
|
||||
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
|
||||
int iomux_err = 0;
|
||||
#endif
|
||||
int flushpoint;
|
||||
|
||||
/* update silent for env loaded from flash (initr_env) */
|
||||
if (console_update_silent())
|
||||
flushpoint = PRE_CONSOLE_FLUSHPOINT1_SERIAL;
|
||||
else
|
||||
flushpoint = PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL;
|
||||
|
||||
/* set default handlers at first */
|
||||
gd->jt->getc = serial_getc;
|
||||
@ -862,7 +888,7 @@ done:
|
||||
if ((stdio_devices[stdin] == NULL) && (stdio_devices[stdout] == NULL))
|
||||
return 0;
|
||||
#endif
|
||||
print_pre_console_buffer(PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL);
|
||||
print_pre_console_buffer(flushpoint);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -876,8 +902,13 @@ int console_init_r(void)
|
||||
struct list_head *list = stdio_get_list();
|
||||
struct list_head *pos;
|
||||
struct stdio_dev *dev;
|
||||
int flushpoint;
|
||||
|
||||
console_update_silent();
|
||||
/* update silent for env loaded from flash (initr_env) */
|
||||
if (console_update_silent())
|
||||
flushpoint = PRE_CONSOLE_FLUSHPOINT1_SERIAL;
|
||||
else
|
||||
flushpoint = PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL;
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
/*
|
||||
@ -940,7 +971,7 @@ int console_init_r(void)
|
||||
if ((stdio_devices[stdin] == NULL) && (stdio_devices[stdout] == NULL))
|
||||
return 0;
|
||||
#endif
|
||||
print_pre_console_buffer(PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL);
|
||||
print_pre_console_buffer(flushpoint);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -153,4 +153,46 @@ void android_dt_print_contents(ulong hdr_addr)
|
||||
unmap_sysmem(fdt);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get dtb index based on board identifier and revision.
|
||||
*
|
||||
* @param hdr_addr Start address of DT image
|
||||
* @param board_id board identifier
|
||||
* @param board_rev board revision (0 if not used)
|
||||
*
|
||||
* @return index in dt table
|
||||
*/
|
||||
int android_dt_get_index(ulong hdr_addr, u32 board_id, u32 board_rev)
|
||||
{
|
||||
const struct dt_table_header *hdr;
|
||||
u32 entry_count, entries_offset, entry_size;
|
||||
u32 i;
|
||||
int ret = -1;
|
||||
|
||||
hdr = map_sysmem(hdr_addr, sizeof(*hdr));
|
||||
entry_count = fdt32_to_cpu(hdr->dt_entry_count);
|
||||
entries_offset = fdt32_to_cpu(hdr->dt_entries_offset);
|
||||
entry_size = fdt32_to_cpu(hdr->dt_entry_size);
|
||||
unmap_sysmem(hdr);
|
||||
|
||||
for (i = 0; i < entry_count; ++i) {
|
||||
const ulong e_addr = hdr_addr + entries_offset + i * entry_size;
|
||||
const struct dt_table_entry *e;
|
||||
|
||||
e = map_sysmem(e_addr, sizeof(*e));
|
||||
|
||||
if ((fdt32_to_cpu(e->id) == board_id) &&
|
||||
(board_rev == 0 || fdt32_to_cpu(e->rev) == board_rev)) {
|
||||
ret = i;
|
||||
unmap_sysmem(e);
|
||||
break;
|
||||
}
|
||||
|
||||
unmap_sysmem(e);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -166,6 +166,7 @@ static const table_entry_t uimage_type[] = {
|
||||
{ IH_TYPE_FIRMWARE_IVT, "firmware_ivt", "Firmware with HABv4 IVT" },
|
||||
{ IH_TYPE_PMMC, "pmmc", "TI Power Management Micro-Controller Firmware",},
|
||||
{ IH_TYPE_STM32IMAGE, "stm32image", "STMicroelectronics STM32 Image" },
|
||||
{ IH_TYPE_STM32COPRO, "stm32copro", "STMicroelectronics STM32 Coprocessor Image"},
|
||||
{ -1, "", "", },
|
||||
};
|
||||
|
||||
|
||||
@ -77,12 +77,21 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
|
||||
|
||||
/*
|
||||
* Load U-Boot image from SPI flash into RAM
|
||||
* In DM mode: defaults speed and mode will be
|
||||
* taken from DT when available
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DM_SPI_FLASH
|
||||
/* In DM mode defaults will be taken from DT */
|
||||
flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
|
||||
CONFIG_SF_DEFAULT_CS,
|
||||
0,
|
||||
0);
|
||||
#else
|
||||
flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
|
||||
CONFIG_SF_DEFAULT_CS,
|
||||
CONFIG_SF_DEFAULT_SPEED,
|
||||
CONFIG_SF_DEFAULT_MODE);
|
||||
#endif
|
||||
if (!flash) {
|
||||
puts("SPI probe failed.\n");
|
||||
return -ENODEV;
|
||||
|
||||
@ -233,6 +233,8 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
|
||||
request, requesttype, value, index, size);
|
||||
dev->status = USB_ST_NOT_PROC; /*not yet processed */
|
||||
|
||||
mdelay(5);
|
||||
|
||||
err = submit_control_msg(dev, pipe, data, size, setup_packet);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@ -215,3 +215,5 @@ CONFIG_UT_TIME=y
|
||||
CONFIG_UT_DM=y
|
||||
CONFIG_UT_ENV=y
|
||||
CONFIG_UT_OVERLAY=y
|
||||
CONFIG_DM_HWSPINLOCK=y
|
||||
CONFIG_HWSPINLOCK_SANDBOX=y
|
||||
|
||||
@ -1,65 +1,129 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARCH_STM32MP=y
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x2000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x3000
|
||||
CONFIG_SPL_MMC_SUPPORT=y
|
||||
CONFIG_SPL=y
|
||||
CONFIG_TARGET_STM32MP1=y
|
||||
CONFIG_SPL_SPI_FLASH_SUPPORT=y
|
||||
CONFIG_SPL_SPI_SUPPORT=y
|
||||
# CONFIG_ARMV7_VIRT is not set
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_FIT=y
|
||||
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3
|
||||
CONFIG_SPL_I2C_SUPPORT=y
|
||||
CONFIG_SPL_MTD_SUPPORT=y
|
||||
CONFIG_SPL_POWER_SUPPORT=y
|
||||
CONFIG_SYS_PROMPT="STM32MP> "
|
||||
# CONFIG_CMD_BOOTD is not set
|
||||
CONFIG_CMD_DTIMG=y
|
||||
# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_IMI is not set
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_EXPORTENV is not set
|
||||
# CONFIG_CMD_IMPORTENV is not set
|
||||
CONFIG_CMD_MEMINFO=y
|
||||
CONFIG_CMD_MEMTEST=y
|
||||
CONFIG_CMD_ADC=y
|
||||
CONFIG_CMD_CLK=y
|
||||
CONFIG_CMD_DFU=y
|
||||
CONFIG_CMD_FUSE=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_GPT=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_REMOTEPROC=y
|
||||
CONFIG_CMD_SF=y
|
||||
CONFIG_CMD_SPI=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
CONFIG_CMD_BMP=y
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_TIMER=y
|
||||
CONFIG_CMD_PMIC=y
|
||||
CONFIG_CMD_REGULATOR=y
|
||||
CONFIG_CMD_EXT4_WRITE=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_CMD_UBI=y
|
||||
# CONFIG_SPL_DOS_PARTITION is not set
|
||||
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
|
||||
CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-names interrupts-extended interrupt-controller \\\#interrupt-cells interrupt-parent dmas dma-names assigned-clocks assigned-clock-rates assigned-clock-parents hwlocks"
|
||||
CONFIG_ENV_IS_NOWHERE=y
|
||||
CONFIG_ENV_IS_IN_EXT4=y
|
||||
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
||||
CONFIG_ENV_IS_IN_UBI=y
|
||||
CONFIG_ENV_EXT4_INTERFACE="mmc"
|
||||
CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"
|
||||
CONFIG_ENV_EXT4_FILE="/uboot.env"
|
||||
CONFIG_STM32_ADC=y
|
||||
CONFIG_USB_FUNCTION_FASTBOOT=y
|
||||
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
|
||||
CONFIG_FASTBOOT_BUF_SIZE=0x02000000
|
||||
CONFIG_FASTBOOT_USB_DEV=1
|
||||
CONFIG_FASTBOOT_FLASH=y
|
||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
|
||||
CONFIG_DM_HWSPINLOCK=y
|
||||
CONFIG_HWSPINLOCK_STM32=y
|
||||
CONFIG_DM_I2C=y
|
||||
CONFIG_SYS_I2C_STM32F7=y
|
||||
CONFIG_LED=y
|
||||
CONFIG_LED_GPIO=y
|
||||
CONFIG_DM_MAILBOX=y
|
||||
CONFIG_STM32_IPCC=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_STM32_SDMMC2=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_NAND=y
|
||||
CONFIG_NAND_STM32_FMC2=y
|
||||
CONFIG_DM_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH_BAR=y
|
||||
CONFIG_SPI_FLASH_MACRONIX=y
|
||||
CONFIG_SPI_FLASH_SPANSION=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_DM_ETH=y
|
||||
CONFIG_DWC_ETH_QOS=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PHY_STM32_USBPHYC=y
|
||||
# CONFIG_PINCTRL_FULL is not set
|
||||
CONFIG_PINCONF=y
|
||||
# CONFIG_SPL_PINCTRL_FULL is not set
|
||||
CONFIG_PINCTRL_STMFX=y
|
||||
CONFIG_DM_PMIC=y
|
||||
# CONFIG_SPL_PMIC_CHILDREN is not set
|
||||
CONFIG_PMIC_STPMU1=y
|
||||
CONFIG_PMIC_STPMIC1=y
|
||||
CONFIG_DM_REGULATOR_FIXED=y
|
||||
CONFIG_DM_REGULATOR_GPIO=y
|
||||
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
|
||||
CONFIG_DM_REGULATOR_STPMU1=y
|
||||
CONFIG_DM_REGULATOR_STPMIC1=y
|
||||
CONFIG_STM32MP1_DDR_INTERACTIVE=y
|
||||
CONFIG_REMOTEPROC_STM32_COPRO=y
|
||||
CONFIG_DM_RTC=y
|
||||
CONFIG_RTC_STM32=y
|
||||
CONFIG_SERIAL_RX_BUFFER=y
|
||||
CONFIG_STM32_SERIAL=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_STM32_QSPI=y
|
||||
CONFIG_STM32_SPI=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_DM_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_GENERIC=y
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x0483
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
|
||||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_BACKLIGHT_GPIO=y
|
||||
CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
|
||||
CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y
|
||||
CONFIG_VIDEO_STM32=y
|
||||
CONFIG_VIDEO_STM32_DSI=y
|
||||
CONFIG_VIDEO_STM32_MAX_XRES=1280
|
||||
CONFIG_VIDEO_STM32_MAX_YRES=800
|
||||
CONFIG_FDT_FIXUP_PARTITIONS=y
|
||||
|
||||
115
configs/stm32mp15_optee_defconfig
Normal file
115
configs/stm32mp15_optee_defconfig
Normal file
@ -0,0 +1,115 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARCH_STM32MP=y
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x3000
|
||||
CONFIG_TARGET_STM32MP1=y
|
||||
CONFIG_STM32MP1_OPTEE=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_FIT=y
|
||||
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
|
||||
CONFIG_SYS_PROMPT="STM32MP> "
|
||||
# CONFIG_CMD_BOOTD is not set
|
||||
CONFIG_CMD_DTIMG=y
|
||||
# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_IMI is not set
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_EXPORTENV is not set
|
||||
# CONFIG_CMD_IMPORTENV is not set
|
||||
CONFIG_CMD_MEMINFO=y
|
||||
CONFIG_CMD_MEMTEST=y
|
||||
CONFIG_CMD_ADC=y
|
||||
CONFIG_CMD_CLK=y
|
||||
CONFIG_CMD_DFU=y
|
||||
CONFIG_CMD_FUSE=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_REMOTEPROC=y
|
||||
CONFIG_CMD_SF=y
|
||||
CONFIG_CMD_SPI=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
CONFIG_CMD_BMP=y
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_TIMER=y
|
||||
CONFIG_CMD_PMIC=y
|
||||
CONFIG_CMD_REGULATOR=y
|
||||
CONFIG_CMD_EXT4_WRITE=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
|
||||
CONFIG_ENV_IS_NOWHERE=y
|
||||
CONFIG_ENV_IS_IN_EXT4=y
|
||||
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
||||
CONFIG_ENV_IS_IN_UBI=y
|
||||
CONFIG_ENV_EXT4_INTERFACE="mmc"
|
||||
CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"
|
||||
CONFIG_ENV_EXT4_FILE="/uboot.env"
|
||||
CONFIG_STM32_ADC=y
|
||||
CONFIG_USB_FUNCTION_FASTBOOT=y
|
||||
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
|
||||
CONFIG_FASTBOOT_BUF_SIZE=0x02000000
|
||||
CONFIG_FASTBOOT_USB_DEV=1
|
||||
CONFIG_FASTBOOT_FLASH=y
|
||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
|
||||
CONFIG_DM_HWSPINLOCK=y
|
||||
CONFIG_HWSPINLOCK_STM32=y
|
||||
CONFIG_DM_I2C=y
|
||||
CONFIG_SYS_I2C_STM32F7=y
|
||||
CONFIG_LED=y
|
||||
CONFIG_LED_GPIO=y
|
||||
CONFIG_DM_MAILBOX=y
|
||||
CONFIG_STM32_IPCC=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_STM32_SDMMC2=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_NAND=y
|
||||
CONFIG_NAND_STM32_FMC2=y
|
||||
CONFIG_DM_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH_BAR=y
|
||||
CONFIG_SPI_FLASH_MACRONIX=y
|
||||
CONFIG_SPI_FLASH_SPANSION=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_DM_ETH=y
|
||||
CONFIG_DWC_ETH_QOS=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PHY_STM32_USBPHYC=y
|
||||
CONFIG_PINCONF=y
|
||||
CONFIG_PINCTRL_STMFX=y
|
||||
CONFIG_DM_PMIC=y
|
||||
CONFIG_PMIC_STPMIC1=y
|
||||
CONFIG_DM_REGULATOR_FIXED=y
|
||||
CONFIG_DM_REGULATOR_GPIO=y
|
||||
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
|
||||
CONFIG_DM_REGULATOR_STPMIC1=y
|
||||
CONFIG_REMOTEPROC_STM32_COPRO=y
|
||||
CONFIG_DM_RTC=y
|
||||
CONFIG_RTC_STM32=y
|
||||
CONFIG_SERIAL_RX_BUFFER=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_STM32_QSPI=y
|
||||
CONFIG_STM32_SPI=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_DM_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_GENERIC=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x0483
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
|
||||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_BACKLIGHT_GPIO=y
|
||||
CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
|
||||
CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y
|
||||
CONFIG_VIDEO_STM32=y
|
||||
CONFIG_VIDEO_STM32_DSI=y
|
||||
CONFIG_VIDEO_STM32_MAX_XRES=1280
|
||||
CONFIG_VIDEO_STM32_MAX_YRES=800
|
||||
CONFIG_FDT_FIXUP_PARTITIONS=y
|
||||
114
configs/stm32mp15_trusted_defconfig
Normal file
114
configs/stm32mp15_trusted_defconfig
Normal file
@ -0,0 +1,114 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARCH_STM32MP=y
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x3000
|
||||
CONFIG_TARGET_STM32MP1=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_FIT=y
|
||||
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
|
||||
CONFIG_SYS_PROMPT="STM32MP> "
|
||||
# CONFIG_CMD_BOOTD is not set
|
||||
CONFIG_CMD_DTIMG=y
|
||||
# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_IMI is not set
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_EXPORTENV is not set
|
||||
# CONFIG_CMD_IMPORTENV is not set
|
||||
CONFIG_CMD_MEMINFO=y
|
||||
CONFIG_CMD_MEMTEST=y
|
||||
CONFIG_CMD_ADC=y
|
||||
CONFIG_CMD_CLK=y
|
||||
CONFIG_CMD_DFU=y
|
||||
CONFIG_CMD_FUSE=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_REMOTEPROC=y
|
||||
CONFIG_CMD_SF=y
|
||||
CONFIG_CMD_SPI=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
CONFIG_CMD_BMP=y
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_TIMER=y
|
||||
CONFIG_CMD_PMIC=y
|
||||
CONFIG_CMD_REGULATOR=y
|
||||
CONFIG_CMD_EXT4_WRITE=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
|
||||
CONFIG_ENV_IS_NOWHERE=y
|
||||
CONFIG_ENV_IS_IN_EXT4=y
|
||||
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
||||
CONFIG_ENV_IS_IN_UBI=y
|
||||
CONFIG_ENV_EXT4_INTERFACE="mmc"
|
||||
CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"
|
||||
CONFIG_ENV_EXT4_FILE="/uboot.env"
|
||||
CONFIG_STM32_ADC=y
|
||||
CONFIG_USB_FUNCTION_FASTBOOT=y
|
||||
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
|
||||
CONFIG_FASTBOOT_BUF_SIZE=0x02000000
|
||||
CONFIG_FASTBOOT_USB_DEV=1
|
||||
CONFIG_FASTBOOT_FLASH=y
|
||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
|
||||
CONFIG_DM_HWSPINLOCK=y
|
||||
CONFIG_HWSPINLOCK_STM32=y
|
||||
CONFIG_DM_I2C=y
|
||||
CONFIG_SYS_I2C_STM32F7=y
|
||||
CONFIG_LED=y
|
||||
CONFIG_LED_GPIO=y
|
||||
CONFIG_DM_MAILBOX=y
|
||||
CONFIG_STM32_IPCC=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_STM32_SDMMC2=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_NAND=y
|
||||
CONFIG_NAND_STM32_FMC2=y
|
||||
CONFIG_DM_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH_BAR=y
|
||||
CONFIG_SPI_FLASH_MACRONIX=y
|
||||
CONFIG_SPI_FLASH_SPANSION=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_DM_ETH=y
|
||||
CONFIG_DWC_ETH_QOS=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PHY_STM32_USBPHYC=y
|
||||
CONFIG_PINCONF=y
|
||||
CONFIG_PINCTRL_STMFX=y
|
||||
CONFIG_DM_PMIC=y
|
||||
CONFIG_PMIC_STPMIC1=y
|
||||
CONFIG_DM_REGULATOR_FIXED=y
|
||||
CONFIG_DM_REGULATOR_GPIO=y
|
||||
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
|
||||
CONFIG_DM_REGULATOR_STPMIC1=y
|
||||
CONFIG_REMOTEPROC_STM32_COPRO=y
|
||||
CONFIG_DM_RTC=y
|
||||
CONFIG_RTC_STM32=y
|
||||
CONFIG_SERIAL_RX_BUFFER=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_STM32_QSPI=y
|
||||
CONFIG_STM32_SPI=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_DM_USB=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_GENERIC=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x0483
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
|
||||
CONFIG_USB_GADGET_DWC2_OTG=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_BACKLIGHT_GPIO=y
|
||||
CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
|
||||
CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y
|
||||
CONFIG_VIDEO_STM32=y
|
||||
CONFIG_VIDEO_STM32_DSI=y
|
||||
CONFIG_VIDEO_STM32_MAX_XRES=1280
|
||||
CONFIG_VIDEO_STM32_MAX_YRES=800
|
||||
CONFIG_FDT_FIXUP_PARTITIONS=y
|
||||
17
doc/device-tree-bindings/arm/stm32.txt
Normal file
17
doc/device-tree-bindings/arm/stm32.txt
Normal file
@ -0,0 +1,17 @@
|
||||
STMicroelectronics STM32 Platforms Device Tree Bindings
|
||||
|
||||
Each device tree must specify which STM32 SoC it uses,
|
||||
using one of the following compatible strings:
|
||||
|
||||
st,stm32f429
|
||||
st,stm32f469
|
||||
st,stm32f746
|
||||
st,stm32h743
|
||||
st,stm32mp157
|
||||
|
||||
Required nodes:
|
||||
|
||||
- syscon: some subnode of the STM32 SoC node must be a
|
||||
system controller node pointing to the control registers,
|
||||
with the compatible string set to one of these tuples:
|
||||
"st,stm32-syscfg", "syscon"
|
||||
@ -10,6 +10,7 @@ Required properties:
|
||||
- compatible: Should be:
|
||||
"st,stm32f42xx-rcc"
|
||||
"st,stm32f469-rcc"
|
||||
"st,stm32f746-rcc"
|
||||
- reg: should be register base and length as documented in the
|
||||
datasheet
|
||||
- #reset-cells: 1, see below
|
||||
@ -17,6 +18,9 @@ Required properties:
|
||||
property, containing a phandle to the clock device node, an index selecting
|
||||
between gated clocks and other clocks and an index specifying the clock to
|
||||
use.
|
||||
- clocks: External oscillator clock phandle
|
||||
- high speed external clock signal (HSE)
|
||||
- external I2S clock (I2S_CKIN)
|
||||
|
||||
Example:
|
||||
|
||||
@ -25,6 +29,7 @@ Example:
|
||||
#clock-cells = <2>
|
||||
compatible = "st,stm32f42xx-rcc", "st,stm32-rcc";
|
||||
reg = <0x40023800 0x400>;
|
||||
clocks = <&clk_hse>, <&clk_i2s_ckin>;
|
||||
};
|
||||
|
||||
Specifying gated clocks
|
||||
@ -66,6 +71,38 @@ The secondary index is bound with the following magic numbers:
|
||||
|
||||
0 SYSTICK
|
||||
1 FCLK
|
||||
2 CLK_LSI (low-power clock source)
|
||||
3 CLK_LSE (generated from a 32.768 kHz low-speed external
|
||||
crystal or ceramic resonator)
|
||||
4 CLK_HSE_RTC (HSE division factor for RTC clock)
|
||||
5 CLK_RTC (real-time clock)
|
||||
6 PLL_VCO_I2S (vco frequency of I2S pll)
|
||||
7 PLL_VCO_SAI (vco frequency of SAI pll)
|
||||
8 CLK_LCD (LCD-TFT)
|
||||
9 CLK_I2S (I2S clocks)
|
||||
10 CLK_SAI1 (audio clocks)
|
||||
11 CLK_SAI2
|
||||
12 CLK_I2SQ_PDIV (post divisor of pll i2s q divisor)
|
||||
13 CLK_SAIQ_PDIV (post divisor of pll sai q divisor)
|
||||
|
||||
14 CLK_HSI (Internal ocscillator clock)
|
||||
15 CLK_SYSCLK (System Clock)
|
||||
16 CLK_HDMI_CEC (HDMI-CEC clock)
|
||||
17 CLK_SPDIF (SPDIF-Rx clock)
|
||||
18 CLK_USART1 (U(s)arts clocks)
|
||||
19 CLK_USART2
|
||||
20 CLK_USART3
|
||||
21 CLK_UART4
|
||||
22 CLK_UART5
|
||||
23 CLK_USART6
|
||||
24 CLK_UART7
|
||||
25 CLK_UART8
|
||||
26 CLK_I2C1 (I2S clocks)
|
||||
27 CLK_I2C2
|
||||
28 CLK_I2C3
|
||||
29 CLK_I2C4
|
||||
30 CLK_LPTIMER (LPTimer1 clock)
|
||||
)
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user