From b73e531f94d8909d1f7c524bf32c5d675cc9f778 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 5 Aug 2018 11:44:18 +0100 Subject: [PATCH] add emmc dummy peripheral --- docs/AddingPeripherals.mdwn | 30 +++++++++++++++++++++++++++ src/bsv/Makefile.peripherals.template | 1 + src/bsv/Makefile.template | 1 + 3 files changed, 32 insertions(+) diff --git a/docs/AddingPeripherals.mdwn b/docs/AddingPeripherals.mdwn index a781c90..a93f74c 100644 --- a/docs/AddingPeripherals.mdwn +++ b/docs/AddingPeripherals.mdwn @@ -1123,6 +1123,36 @@ The last remaining task will therefore be to create an interim emmc ## Creating the dummy emmc peripheral +Adding the actual peripheral is done in a different repository, +shakti-peripherals, which can be cloned with: + + $ git clone gitolite3@libre-riscv.org:shakti-peripherals.git + +or public: + + $ git clone git://libre-riscv.org/shakti-peripherals.git + +Here, what we will do is take a straight copy of +src/peripherals/sdmmc/sdcard\_dummy.bsv and call it +src/peripherals/emmc/emmc\_dummy.bsv. Then replace all occurrences +of "sdcard" with "emmc" and also update the SDBUSWIDTH from 4 to 8. +Whilst this appears wasteful it is by far the simplest and quickest +way to get working code, that should definitely, definitely be +re-factored later. + +The next stage is to return to the pinmux repository and add the +import of the new emmc subdirectory to the BSVINCDIR in both +src/bsv/Makefile.template and Makefile.peripherals.template: + + BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/spi + BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/sdmmc + BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/emmc + BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/flexbus + +Really these should also be auto-generated. Testing through compiling +can now take place. + + # Conclusion This is not a small project, by any means. However the payoff in saved diff --git a/src/bsv/Makefile.peripherals.template b/src/bsv/Makefile.peripherals.template index 7e901cd..23c90f6 100644 --- a/src/bsv/Makefile.peripherals.template +++ b/src/bsv/Makefile.peripherals.template @@ -25,6 +25,7 @@ BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/pwm BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/qspi BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/spi BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/sdmmc +BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/emmc BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/flexbus BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/jtagdtm BSVINCDIR:= $(BSVINCDIR):../../../shakti-peripherals/src/peripherals/uart diff --git a/src/bsv/Makefile.template b/src/bsv/Makefile.template index 7d7f821..ab58b51 100644 --- a/src/bsv/Makefile.template +++ b/src/bsv/Makefile.template @@ -25,6 +25,7 @@ BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/pwm BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/qspi BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/spi BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/sdmmc +BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/emmc BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/flexbus BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/jtagdtm BSVINCDIR:= $(BSVINCDIR):../../../src/peripherals/src/peripherals/uart -- 2.30.2