diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/cpu/u-boot-spl.lds | 2 | ||||
-rw-r--r-- | arch/riscv/cpu/u-boot.lds | 3 | ||||
-rw-r--r-- | arch/riscv/dts/binman.dtsi | 2 | ||||
-rw-r--r-- | arch/riscv/dts/k1-bananapi-f3.dts | 3 | ||||
-rw-r--r-- | arch/riscv/dts/k1-pinctrl.dtsi | 19 | ||||
-rw-r--r-- | arch/riscv/dts/k1.dtsi | 8 | ||||
-rw-r--r-- | arch/riscv/dts/starfive-visionfive2-binman.dtsi | 1 | ||||
-rw-r--r-- | arch/riscv/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/riscv/lib/board.c | 19 |
9 files changed, 56 insertions, 2 deletions
diff --git a/arch/riscv/cpu/u-boot-spl.lds b/arch/riscv/cpu/u-boot-spl.lds index 907094620bd..0717833df55 100644 --- a/arch/riscv/cpu/u-boot-spl.lds +++ b/arch/riscv/cpu/u-boot-spl.lds @@ -16,6 +16,7 @@ ENTRY(_start) SECTIONS { . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { arch/riscv/cpu/start.o (.text) *(.text*) @@ -46,6 +47,7 @@ SECTIONS _end = .; _image_binary_end = .; + __image_copy_end = .; .bss : { __bss_start = .; diff --git a/arch/riscv/cpu/u-boot.lds b/arch/riscv/cpu/u-boot.lds index 2ffe6ba3c8f..b11ea8b56d2 100644 --- a/arch/riscv/cpu/u-boot.lds +++ b/arch/riscv/cpu/u-boot.lds @@ -10,6 +10,7 @@ ENTRY(_start) SECTIONS { . = ALIGN(4); + __image_copy_start = ADDR(.text); .text : { arch/riscv/cpu/start.o (.text) } @@ -57,6 +58,8 @@ SECTIONS __efi_runtime_rel_stop = .; } + __image_copy_end = .; + /DISCARD/ : { *(.rela.plt*) } .rela.dyn : { __rel_dyn_start = .; diff --git a/arch/riscv/dts/binman.dtsi b/arch/riscv/dts/binman.dtsi index ceb916b74a7..5aeeeddb59f 100644 --- a/arch/riscv/dts/binman.dtsi +++ b/arch/riscv/dts/binman.dtsi @@ -35,7 +35,7 @@ compression = "none"; load = /bits/ 64 <CONFIG_TEXT_BASE>; - uboot_blob: blob-ext { + uboot_blob: u-boot-nodtb { filename = "u-boot-nodtb.bin"; }; }; diff --git a/arch/riscv/dts/k1-bananapi-f3.dts b/arch/riscv/dts/k1-bananapi-f3.dts index d2486f70906..6b5b83bcdb9 100644 --- a/arch/riscv/dts/k1-bananapi-f3.dts +++ b/arch/riscv/dts/k1-bananapi-f3.dts @@ -5,6 +5,7 @@ #include "k1.dtsi" #include "binman.dtsi" +#include "k1-pinctrl.dtsi" / { model = "Banana Pi BPI-F3"; @@ -21,5 +22,7 @@ }; &uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_2_cfg>; status = "okay"; }; diff --git a/arch/riscv/dts/k1-pinctrl.dtsi b/arch/riscv/dts/k1-pinctrl.dtsi new file mode 100644 index 00000000000..14e7096fbcf --- /dev/null +++ b/arch/riscv/dts/k1-pinctrl.dtsi @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2022 Spacemit Inc. + * Copyright (C) 2025 Yixun Lan <dlan@gentoo.org> + */ + +#define K1_PADCONF(pin, func) (((pin) << 16) | (func)) + +&pinctrl { + uart0_2_cfg: uart0-2-cfg { + uart0-2-pins { + pinmux = <K1_PADCONF(68, 2)>, + <K1_PADCONF(69, 2)>; + + bias-pull-up = <0>; + drive-strength = <32>; + }; + }; +}; diff --git a/arch/riscv/dts/k1.dtsi b/arch/riscv/dts/k1.dtsi index 7c0f1b928e2..a633e43da32 100644 --- a/arch/riscv/dts/k1.dtsi +++ b/arch/riscv/dts/k1.dtsi @@ -470,5 +470,11 @@ #reset-cells = <1>; status = "disabled"; }; + + pinctrl: pinctrl@d401e000 { + compatible = "spacemit,k1-pinctrl", "pinctrl-single"; + reg = <0x0 0xd401e000 0x0 0x400>; + pinctrl-single,register-width = <32>; + }; }; -};
\ No newline at end of file +}; diff --git a/arch/riscv/dts/starfive-visionfive2-binman.dtsi b/arch/riscv/dts/starfive-visionfive2-binman.dtsi index 05787bdb92d..6e083bf0537 100644 --- a/arch/riscv/dts/starfive-visionfive2-binman.dtsi +++ b/arch/riscv/dts/starfive-visionfive2-binman.dtsi @@ -20,6 +20,7 @@ args = "-T sfspl"; u-boot-spl { + no-write-symbols; }; }; }; diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile index 22b675ffe82..189b35c24d3 100644 --- a/arch/riscv/lib/Makefile +++ b/arch/riscv/lib/Makefile @@ -27,6 +27,7 @@ obj-$(CONFIG_$(PHASE_)SMP) += smp.o obj-$(CONFIG_XPL_BUILD) += spl.o obj-y += fdt_fixup.o obj-$(CONFIG_$(SPL)CMD_BDI) += bdinfo.o +obj-$(CONFIG_OF_BOARD) += board.o # For building EFI apps CFLAGS_NON_EFI := -fstack-protector-strong diff --git a/arch/riscv/lib/board.c b/arch/riscv/lib/board.c new file mode 100644 index 00000000000..624c4eaaf4d --- /dev/null +++ b/arch/riscv/lib/board.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * RISC-V-specific handling of firmware FDT + */ + +#include <asm/global_data.h> +#include <linux/errno.h> + +DECLARE_GLOBAL_DATA_PTR; + +__weak int board_fdt_blob_setup(void **fdtp) +{ + if (!gd->arch.firmware_fdt_addr) + return -EEXIST; + + *fdtp = (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; + + return 0; +} |