* Question: SiFive U SPI and SD [not found] <CANA1cB+D-Uth0C-6qNE5HcAJkQeDsCbKqmYG7uHsLqbbofSsZQ@mail.gmail.com> @ 2020-02-09 14:54 ` Nikita Ermakov 2020-02-10 15:50 ` Bin Meng 0 siblings, 1 reply; 4+ messages in thread From: Nikita Ermakov @ 2020-02-09 14:54 UTC (permalink / raw) To: qemu-devel@nongnu.org Developers [-- Attachment #1: Type: text/plain, Size: 817 bytes --] Hello! I am trying to make an SD card working on the sifive_u (hw/riscv/sifive_u.c) SoC machine. As far as I understand there is no way to connect an SD card to the SoC with cmdline for now. So, I started to dig in to the QEMU internals and especially sifive_u SoC implementation to try to understand how I could connect SD card to this SoC. From what I understood I need to: 1) Implement SiFive U SPI controller. 2) Implement spi-sd adapter in a way like the hw/sd/ssi-sd.c Probably I should merge 1) and 2) into one hw/riscv/sifive_u_spi.c source file. Could somebody correct me please if I am wrong at some point? I am newbie in the QEMU internals :) The purpose is why I want to implement this is to boot up the Linux kernel on '-machine sifive_u' and load rootfs from SD. -- Thanks, Nikita B8 00 4C CD 21 [-- Attachment #2: Type: text/html, Size: 1085 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question: SiFive U SPI and SD 2020-02-09 14:54 ` Question: SiFive U SPI and SD Nikita Ermakov @ 2020-02-10 15:50 ` Bin Meng 2020-02-12 21:09 ` Alistair Francis 0 siblings, 1 reply; 4+ messages in thread From: Bin Meng @ 2020-02-10 15:50 UTC (permalink / raw) To: Nikita Ermakov; +Cc: qemu-devel@nongnu.org Developers Hi Nikita, On Sun, Feb 9, 2020 at 10:56 PM Nikita Ermakov <arei@altlinux.org> wrote: > > Hello! > > I am trying to make an SD card working on the sifive_u (hw/riscv/sifive_u.c) SoC machine. > As far as I understand there is no way to connect an SD card to the SoC with cmdline for now. So, I started to dig in to the QEMU internals and especially sifive_u SoC implementation to try to understand how I could connect SD card to this SoC. > > From what I understood I need to: > 1) Implement SiFive U SPI controller. This one is definitely needed. > 2) Implement spi-sd adapter in a way like the hw/sd/ssi-sd.c I believe we can just use hw/sd/ssi-sd.c. > > Probably I should merge 1) and 2) into one hw/riscv/sifive_u_spi.c source file. > > Could somebody correct me please if I am wrong at some point? > I am newbie in the QEMU internals :) > > The purpose is why I want to implement this is to boot up the Linux kernel on '-machine sifive_u' and load rootfs from SD. Regards, Bin ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question: SiFive U SPI and SD 2020-02-10 15:50 ` Bin Meng @ 2020-02-12 21:09 ` Alistair Francis 2020-02-12 21:58 ` Nikita Ermakov 0 siblings, 1 reply; 4+ messages in thread From: Alistair Francis @ 2020-02-12 21:09 UTC (permalink / raw) To: Bin Meng; +Cc: Nikita Ermakov, qemu-devel@nongnu.org Developers On Mon, Feb 10, 2020 at 7:51 AM Bin Meng <bmeng.cn@gmail.com> wrote: > > Hi Nikita, > > On Sun, Feb 9, 2020 at 10:56 PM Nikita Ermakov <arei@altlinux.org> wrote: > > > > Hello! > > > > I am trying to make an SD card working on the sifive_u (hw/riscv/sifive_u.c) SoC machine. > > As far as I understand there is no way to connect an SD card to the SoC with cmdline for now. So, I started to dig in to the QEMU internals and especially sifive_u SoC implementation to try to understand how I could connect SD card to this SoC. > > > > From what I understood I need to: > > 1) Implement SiFive U SPI controller. > > This one is definitely needed. > > > 2) Implement spi-sd adapter in a way like the hw/sd/ssi-sd.c > > I believe we can just use hw/sd/ssi-sd.c. I had a crack at this awhile ago and you can see the patches here (I just rebased them): https://github.com/alistair23/qemu/tree/mainline/alistair/sifive_spi.next Debugging failures was really hard in Linux, but now that U-Boot and Oreboot (https://github.com/oreboot/oreboot/pull/234) have SPI support it is probably easier to debug. If you wanted to help you could try to debug that branch and figure out why it isn't working. Alistair > > > > > Probably I should merge 1) and 2) into one hw/riscv/sifive_u_spi.c source file. > > > > Could somebody correct me please if I am wrong at some point? > > I am newbie in the QEMU internals :) > > > > The purpose is why I want to implement this is to boot up the Linux kernel on '-machine sifive_u' and load rootfs from SD. > > Regards, > Bin > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question: SiFive U SPI and SD 2020-02-12 21:09 ` Alistair Francis @ 2020-02-12 21:58 ` Nikita Ermakov 0 siblings, 0 replies; 4+ messages in thread From: Nikita Ermakov @ 2020-02-12 21:58 UTC (permalink / raw) To: Alistair Francis Cc: Bin Meng, Nikita Ermakov, qemu-devel@nongnu.org Developers [-- Attachment #1: Type: text/plain, Size: 640 bytes --] Hello, Bin, Alistair, Thank you for the answers! On Thu, 13 Feb 2020 at 00:16, Alistair Francis <alistair23@gmail.com> wrote: > I had a crack at this awhile ago and you can see the patches here (I > just rebased them): > https://github.com/alistair23/qemu/tree/mainline/alistair/sifive_spi.next > > Debugging failures was really hard in Linux, but now that U-Boot and > Oreboot (https://github.com/oreboot/oreboot/pull/234) have SPI support > it is probably easier to debug. > > If you wanted to help you could try to debug that branch and figure > out why it isn't working. > Thanks! I will try that. -- Thanks, Nikita B8 00 4C CD 21 [-- Attachment #2: Type: text/html, Size: 1356 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-12 22:05 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <CANA1cB+D-Uth0C-6qNE5HcAJkQeDsCbKqmYG7uHsLqbbofSsZQ@mail.gmail.com> 2020-02-09 14:54 ` Question: SiFive U SPI and SD Nikita Ermakov 2020-02-10 15:50 ` Bin Meng 2020-02-12 21:09 ` Alistair Francis 2020-02-12 21:58 ` Nikita Ermakov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).