From 161f39f7af436e0f62e34b03d8ba34dcf627a2e5 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 11 Feb 2019 15:03:11 +0100 Subject: [PATCH] imx6q_sabrelite: enable sd_card_drv --- repos/base/include/drivers/defs/imx6.h | 15 ++++++++-- .../{imx6 => imx6q_sabrelite}/sd_card_drv.mk | 2 +- .../src/drivers/sd_card/spec/imx6/driver.cc | 12 -------- .../sd_card/spec/imx6q_sabrelite/driver.cc | 29 +++++++++++++++++++ 4 files changed, 42 insertions(+), 16 deletions(-) rename repos/os/lib/mk/spec/{imx6 => imx6q_sabrelite}/sd_card_drv.mk (55%) create mode 100644 repos/os/src/drivers/sd_card/spec/imx6q_sabrelite/driver.cc diff --git a/repos/base/include/drivers/defs/imx6.h b/repos/base/include/drivers/defs/imx6.h index 9c317b371e..bc374cbde6 100644 --- a/repos/base/include/drivers/defs/imx6.h +++ b/repos/base/include/drivers/defs/imx6.h @@ -58,9 +58,18 @@ namespace Imx6 { CACHE_LINE_SIZE_LOG2 = 5, /* SD host controller */ - SDHC_IRQ = 54, - SDHC_MMIO_BASE = 0x02190000, - SDHC_MMIO_SIZE = 0x00004000, + SDHC_1_IRQ = 54, + SDHC_1_MMIO_BASE = 0x02190000, + SDHC_1_MMIO_SIZE = 0x00004000, + SDHC_2_IRQ = 55, + SDHC_2_MMIO_BASE = 0x02194000, + SDHC_2_MMIO_SIZE = 0x00004000, + SDHC_3_IRQ = 56, + SDHC_3_MMIO_BASE = 0x02198000, + SDHC_3_MMIO_SIZE = 0x00004000, + SDHC_4_IRQ = 57, + SDHC_4_MMIO_BASE = 0x0219c000, + SDHC_4_MMIO_SIZE = 0x00004000, /* GPIO */ GPIO1_MMIO_BASE = 0x0209c000, diff --git a/repos/os/lib/mk/spec/imx6/sd_card_drv.mk b/repos/os/lib/mk/spec/imx6q_sabrelite/sd_card_drv.mk similarity index 55% rename from repos/os/lib/mk/spec/imx6/sd_card_drv.mk rename to repos/os/lib/mk/spec/imx6q_sabrelite/sd_card_drv.mk index 96afda8e68..97a029c1ec 100644 --- a/repos/os/lib/mk/spec/imx6/sd_card_drv.mk +++ b/repos/os/lib/mk/spec/imx6q_sabrelite/sd_card_drv.mk @@ -1,4 +1,4 @@ -SRC_CC += adma2.cc spec/imx/driver.cc spec/imx6/driver.cc +SRC_CC += adma2.cc spec/imx/driver.cc spec/imx6/driver.cc spec/imx6q_sabrelite/driver.cc LIBS += base vpath %.cc $(REP_DIR)/src/drivers/sd_card diff --git a/repos/os/src/drivers/sd_card/spec/imx6/driver.cc b/repos/os/src/drivers/sd_card/spec/imx6/driver.cc index c96290db7c..5a976e002c 100644 --- a/repos/os/src/drivers/sd_card/spec/imx6/driver.cc +++ b/repos/os/src/drivers/sd_card/spec/imx6/driver.cc @@ -13,7 +13,6 @@ /* local includes */ #include -#include using namespace Sd_card; using namespace Genode; @@ -116,14 +115,3 @@ void Driver::_disable_clock_preparation() { Mmio::write(0); } void Driver::_enable_clock_finish() { Mmio::write(0); } - - -Driver::Driver(Env &env) -: - Driver_base(env.ram()), - Attached_mmio(env, Imx6::SDHC_MMIO_BASE, Imx6::SDHC_MMIO_SIZE), - _env(env), _irq(env, Imx6::SDHC_IRQ) -{ - log("SD card detected"); - log("capacity: ", card_info().capacity_mb(), " MiB"); -} diff --git a/repos/os/src/drivers/sd_card/spec/imx6q_sabrelite/driver.cc b/repos/os/src/drivers/sd_card/spec/imx6q_sabrelite/driver.cc new file mode 100644 index 0000000000..3b8936b4ab --- /dev/null +++ b/repos/os/src/drivers/sd_card/spec/imx6q_sabrelite/driver.cc @@ -0,0 +1,29 @@ +/* + * \brief Secured Digital Host Controller + * \author Martin Stein + * \date 2016-12-13 + */ + +/* + * Copyright (C) 2016-2017 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +/* local includes */ +#include +#include + +using namespace Sd_card; +using namespace Genode; + +Driver::Driver(Env &env) +: + Driver_base(env.ram()), + Attached_mmio(env, Imx6::SDHC_4_MMIO_BASE, Imx6::SDHC_4_MMIO_SIZE), + _env(env), _irq(env, Imx6::SDHC_4_IRQ) +{ + log("SD card detected"); + log("capacity: ", card_info().capacity_mb(), " MiB"); +}