sd_card_drv: i.MX8 support

Fixes #3580
This commit is contained in:
Christian Prochaska 2019-12-13 13:14:45 +01:00 committed by Christian Helmuth
parent 81a78cf1d0
commit a62fce8dc5
5 changed files with 70 additions and 7 deletions

View File

@ -0,0 +1,26 @@
/*
* \brief MMIO and IRQ definitions for the i.MX8Q EVK board
* \author Christian Prochaska
* \date 2019-09-26
*/
/*
* Copyright (C) 2019 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.
*/
#ifndef _INCLUDE__DRIVERS__DEFS__IMX8Q_EVK_H_
#define _INCLUDE__DRIVERS__DEFS__IMX8Q_EVK_H_
namespace Imx8 {
enum {
/* SD host controller */
SDHC_2_IRQ = 55,
SDHC_2_MMIO_BASE = 0x30b50000,
SDHC_2_MMIO_SIZE = 0x00010000,
};
};
#endif /* _INCLUDE__DRIVERS__DEFS__IMX8Q_EVK_H_ */

View File

@ -3,19 +3,21 @@
#
proc buffer_size_kib {} {
if {[have_spec pl180]} { return [expr 12 * 1024] }
if {[have_spec imx6]} { return [expr 1024] }
if {[have_spec pl180]} { return [expr 12 * 1024] }
if {[have_spec imx8q_evk]} { return [expr 1024] }
if {[have_spec imx6]} { return [expr 1024] }
if {[have_spec imx53] &&
![have_spec foc]} { return [expr 1024] }
if {[have_spec rpi]} { return [expr 4 * 1024] }
if {[have_spec omap4]} { return [expr 4 * 1024] }
if {[have_spec arndale]} { return [expr 1024] }
![have_spec foc]} { return [expr 1024] }
if {[have_spec rpi]} { return [expr 4 * 1024] }
if {[have_spec omap4]} { return [expr 4 * 1024] }
if {[have_spec arndale]} { return [expr 1024] }
puts "\n Run script is not supported on this platform. \n";
exit 0;
}
proc sd_card_drv {} {
if {[have_spec pbxa9]} { return pbxa9_sd_card_drv }
if {[have_spec imx8q_evk]} { return imx8q_evk_sd_card_drv }
if {[have_spec imx6q_sabrelite]} { return imx6q_sabrelite_sd_card_drv }
if {[have_spec imx53]} { return imx53_sd_card_drv }
if {[have_spec rpi]} { return rpi_sd_card_drv }

View File

@ -60,6 +60,6 @@ int Table::setup_request(size_t const size, addr_t const buffer_phys)
consumed += curr;
}
/* ensure that all descriptor writes were actually executed */
asm volatile ("dsb");
asm volatile ("dsb #15" ::: "memory");
return 0;
}

View File

@ -0,0 +1,29 @@
/*
* \brief Secure Digital Host Controller
* \author Christian Prochaska
* \date 2019-09-26
*/
/*
* Copyright (C) 2019 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 <driver.h>
#include <drivers/defs/imx8q_evk.h>
using namespace Sd_card;
using namespace Genode;
Driver::Driver(Env &env)
:
Driver_base(env.ram()),
Attached_mmio(env, Imx8::SDHC_2_MMIO_BASE, Imx8::SDHC_2_MMIO_SIZE),
_env(env), _irq(env, Imx8::SDHC_2_IRQ)
{
log("SD card detected");
log("capacity: ", card_info().capacity_mb(), " MiB");
}

View File

@ -0,0 +1,6 @@
TARGET = imx8q_evk_sd_card_drv
REQUIRES = arm_v8
SRC_CC += adma2.cc spec/imx/driver.cc spec/imx6/driver.cc
INC_DIR = $(REP_DIR)/src/drivers/sd_card/spec/imx
include $(REP_DIR)/src/drivers/sd_card/target.inc