From 19dd274b5680940974977c0372e85b91bcbc006e Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 4 Nov 2020 12:49:00 +0100 Subject: [PATCH 1/5] riscv: sort SPECIFIC_OPTIONS Sort implied options in BOARD_SPECIFIC_OPTIONS in the same sequence as in .config. Signed-off-by: Heinrich Schuchardt Reviewed-by: Bin Meng --- board/emulation/qemu-riscv/Kconfig | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig index 617c4aa33f..36d3b68ab9 100644 --- a/board/emulation/qemu-riscv/Kconfig +++ b/board/emulation/qemu-riscv/Kconfig @@ -29,33 +29,33 @@ config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select GENERIC_RISCV select SUPPORT_SPL - imply SYS_NS16550 - imply VIRTIO_MMIO - imply VIRTIO_NET - imply VIRTIO_BLK - imply VIRTIO_PCI + imply SMP + imply BOARD_LATE_INIT + imply SPL_RAM_SUPPORT + imply SPL_RAM_DEVICE + imply CMD_PCI + imply CMD_POWEROFF imply CMD_PING - imply CMD_FS_GENERIC - imply DOS_PARTITION - imply EFI_PARTITION - imply ISO_PARTITION imply CMD_EXT2 imply CMD_EXT4 imply CMD_FAT - imply BOARD_LATE_INIT - imply SIFIVE_SERIAL - imply SMP + imply CMD_FS_GENERIC + imply DOS_PARTITION + imply ISO_PARTITION + imply EFI_PARTITION + imply E1000 + imply NVME imply PCI imply DM_PCI imply PCIE_ECAM_GENERIC - imply CMD_PCI - imply E1000 - imply NVME - imply SPL_RAM_SUPPORT - imply SPL_RAM_DEVICE + imply SYS_NS16550 + imply SIFIVE_SERIAL imply SYSRESET - imply SYSRESET_SYSCON - imply CMD_POWEROFF imply SYSRESET_CMD_POWEROFF + imply SYSRESET_SYSCON + imply VIRTIO_MMIO + imply VIRTIO_PCI + imply VIRTIO_NET + imply VIRTIO_BLK endif From 2873ca2a7855d4a6f2c6cf931cb5a1e8dfce43c0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 4 Nov 2020 12:49:01 +0100 Subject: [PATCH 2/5] riscv: enable SATA disk on QEMU RISC-V Allow attaching a virtual SATA disk to QEMU RISC-V by implying AHCI, AHCI_PCI, CMD_SCSI, DM_SCSI, PCI_INIT_R, SCSI, SCSI_AHCI. Signed-off-by: Heinrich Schuchardt Reviewed-by: Bin Meng --- board/emulation/qemu-riscv/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig index 36d3b68ab9..0818048ba6 100644 --- a/board/emulation/qemu-riscv/Kconfig +++ b/board/emulation/qemu-riscv/Kconfig @@ -29,12 +29,15 @@ config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select GENERIC_RISCV select SUPPORT_SPL + imply AHCI imply SMP imply BOARD_LATE_INIT + imply PCI_INIT_R imply SPL_RAM_SUPPORT imply SPL_RAM_DEVICE imply CMD_PCI imply CMD_POWEROFF + imply CMD_SCSI imply CMD_PING imply CMD_EXT2 imply CMD_EXT4 @@ -43,11 +46,15 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply DOS_PARTITION imply ISO_PARTITION imply EFI_PARTITION + imply SCSI_AHCI + imply AHCI_PCI imply E1000 imply NVME imply PCI imply DM_PCI imply PCIE_ECAM_GENERIC + imply SCSI + imply DM_SCSI imply SYS_NS16550 imply SIFIVE_SERIAL imply SYSRESET From f0b1831864db8c1f234983672f414ced35ee3902 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 4 Nov 2020 12:59:13 +0100 Subject: [PATCH 3/5] doc: qemu-riscv: describe attaching a disk image How to add an emulated disk to QEMU may not be known to the user. Signed-off-by: Heinrich Schuchardt Reviewed-by: Bin Meng --- doc/board/emulation/qemu-riscv.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/board/emulation/qemu-riscv.rst b/doc/board/emulation/qemu-riscv.rst index b68db95a45..3acd40630e 100644 --- a/doc/board/emulation/qemu-riscv.rst +++ b/doc/board/emulation/qemu-riscv.rst @@ -105,3 +105,11 @@ configurations are: qemu-system-riscv64 -nographic -machine virt -bios spl/u-boot-spl \ -device loader,file=u-boot.itb,addr=0x80200000 + +An attached disk can be emulated by adding:: + + -device ich9-ahci,id=ahci \ + -drive if=none,file=riscv64.img,format=raw,id=mydisk \ + -device ide-hd,drive=mydisk,bus=ahci.0 + +You will have to run 'scsi scan' to use it. From 82b838f8dd2bffaffc53b9ca9abab711d8d83d0c Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Fri, 13 Nov 2020 08:43:39 -0500 Subject: [PATCH 4/5] pinctrl: k210: Fix inverted IE and OE for I2C I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and IE_INV set, but I2C cannot have those bits set. This adds a separate default for SCCB. Signed-off-by: Sean Anderson Reported-by: Damien Le Moal --- drivers/pinctrl/pinctrl-kendryte.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c index 5ad049d955..dac3800cab 100644 --- a/drivers/pinctrl/pinctrl-kendryte.c +++ b/drivers/pinctrl/pinctrl-kendryte.c @@ -55,8 +55,9 @@ #define K210_PC_MODE_IN (K210_PC_IE | K210_PC_ST) #define K210_PC_MODE_OUT (K210_PC_DRIVE_7 | K210_PC_OE) -#define K210_PC_MODE_I2C (K210_PC_MODE_IN | K210_PC_IE_INV | K210_PC_SL | \ - K210_PC_OE | K210_PC_OE_INV | K210_PC_PU) +#define K210_PC_MODE_I2C (K210_PC_MODE_IN | K210_PC_SL | K210_PC_OE | \ + K210_PC_PU) +#define K210_PC_MODE_SCCB (K210_PC_MODE_I2C | K210_PC_OE_INV | K210_PC_IE_INV) #define K210_PC_MODE_SPI (K210_PC_MODE_IN | K210_PC_IE_INV | \ K210_PC_MODE_OUT | K210_PC_OE_INV) #define K210_PC_MODE_GPIO (K210_PC_MODE_IN | K210_PC_MODE_OUT) @@ -176,6 +177,7 @@ enum k210_pc_mode_id { K210_PC_DEFAULT_IN_TIE, K210_PC_DEFAULT_OUT, K210_PC_DEFAULT_I2C, + K210_PC_DEFAULT_SCCB, K210_PC_DEFAULT_SPI, K210_PC_DEFAULT_GPIO, K210_PC_DEFAULT_INT13, @@ -189,6 +191,7 @@ static const u32 k210_pc_mode_id_to_mode[] = { [K210_PC_DEFAULT_IN_TIE] = K210_PC_MODE_IN, DEFAULT(OUT), DEFAULT(I2C), + DEFAULT(SCCB), DEFAULT(SPI), DEFAULT(GPIO), [K210_PC_DEFAULT_INT13] = K210_PC_MODE_IN | K210_PC_PU, @@ -362,8 +365,8 @@ static const struct k210_pcf_info k210_pcf_infos[] = { FUNC(DVP_D5, IN), FUNC(DVP_D6, IN), FUNC(DVP_D7, IN), - FUNC(SCCB_SCLK, I2C), - FUNC(SCCB_SDA, I2C), + FUNC(SCCB_SCLK, SCCB), + FUNC(SCCB_SDA, SCCB), FUNC(UART1_CTS, IN), FUNC(UART1_DSR, IN), FUNC(UART1_DCD, IN), From 6e35c1cb12e7be136baf9f44249baa3279ed7b5c Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Fri, 13 Nov 2020 08:43:40 -0500 Subject: [PATCH 5/5] pinctrl: k210: Rename power domains to match datasheet This renames power domains to match the names on the k210 datasheet. Signed-off-by: Sean Anderson Reported-by: Damien Le Moal Reviewed-by: Rick Chen --- .../pinctrl/kendryte,k210-fpioa.txt | 2 +- drivers/pinctrl/pinctrl-kendryte.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt b/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt index 06a9cc060f..73871f5930 100644 --- a/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt +++ b/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt @@ -18,7 +18,7 @@ Pin configuration nodes are documented in pinctrl-bindings.txt Required properties for pin-configuration nodes or sub-nodes are: - groups: list of power groups to which the configuration applies. Valid groups are: - A0, A1, A2, B0, B1, B2, C0, C1 + A0, A1, A2, B3, B4, B5, C6, C7 (either this or "pinmux" must be specified) - pinmux: integer array representing pin multiplexing configuration. In addition to the 256 standard functions, each pin can also output the direction diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c index dac3800cab..04162016cc 100644 --- a/drivers/pinctrl/pinctrl-kendryte.c +++ b/drivers/pinctrl/pinctrl-kendryte.c @@ -153,11 +153,11 @@ static const char k210_pc_group_names[][3] = { [0] = "A0", [1] = "A1", [2] = "A2", - [3] = "B0", - [4] = "B1", - [5] = "B2", - [6] = "C0", - [7] = "C1", + [3] = "B3", + [4] = "B4", + [5] = "B5", + [6] = "C6", + [7] = "C7", }; static int k210_pc_get_groups_count(struct udevice *dev)