diff --git a/src/drivers/sd_card/spec/zynq/main.cc b/src/drivers/sd_card/spec/zynq/main.cc new file mode 100644 index 0000000..e818ee9 --- /dev/null +++ b/src/drivers/sd_card/spec/zynq/main.cc @@ -0,0 +1,59 @@ +/* + * \brief SD-card driver for Zynq boards + * \author Norman Feske + * \authot Timo Wischer + * \date 2014-09-21 + */ + +/* + * Copyright (C) 2014 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* Genode includes */ +#include +#include + +/* local includes */ +#include + + +struct Main +{ + Server::Entrypoint &ep; + + + struct Factory : Block::Driver_factory + { + Block::Driver *create() { + return new (Genode::env()->heap()) Block::Sdhci_driver(false, true); } + + void destroy(Block::Driver *driver) { + Genode::destroy(Genode::env()->heap(), + static_cast(driver)); } + } factory; + + Block::Root root; + + Main(Server::Entrypoint &ep) + : ep(ep), root(ep, Genode::env()->heap(), factory) + { + Genode::printf("--- SD card driver ---\n"); + + Genode::env()->parent()->announce(ep.manage(root)); + } +}; + + +/************ + ** Server ** + ************/ + +namespace Server { + char const *name() { return "sd_card_ep"; } + size_t stack_size() { return 2*1024*sizeof(long); } + void construct(Entrypoint &ep) { static Main server(ep); } +} + diff --git a/src/drivers/sd_card/spec/zynq/target.mk b/src/drivers/sd_card/spec/zynq/target.mk new file mode 100644 index 0000000..367d72c --- /dev/null +++ b/src/drivers/sd_card/spec/zynq/target.mk @@ -0,0 +1,7 @@ +TARGET = sd_card_drv +REQUIRES = zynq +SRC_CC = main.cc +LIBS = base server +INC_DIR += $(PRG_DIR) +INC_DIR += $(REP_DIR)/../os/src/drivers/sd_card/ +INC_DIR += $(REP_DIR)/../os/src/drivers/sd_card/spec/rpi