sd_card_drv: prevent deprecated warnings

This commit is contained in:
Christian Helmuth 2017-06-26 15:17:45 +02:00
parent 18cea099f0
commit 145011b420
13 changed files with 38 additions and 27 deletions

View File

@ -20,9 +20,9 @@
using namespace Adma2;
Table::Table(Ram_session &ram)
Table::Table(Ram_session &ram, Region_map &rm)
:
_ds(&ram, _ds_size, UNCACHED),
_ds(ram, rm, _ds_size, UNCACHED),
_base_virt(_ds.local_addr<Desc::access_t>()),
_base_phys(Dataspace_client(_ds.cap()).phys_addr())
{ }

View File

@ -66,7 +66,7 @@ class Adma2::Table
public:
Table(Ram_session &ram);
Table(Ram_session &ram, Region_map &rm);
/**
* Marshal descriptors according to block request

View File

@ -393,7 +393,7 @@ Csd Driver::_read_csd()
size_t Driver::_read_ext_csd()
{
Attached_ram_dataspace ds(&_env.ram(), 0x1000, UNCACHED);
Attached_ram_dataspace ds(_env.ram(), _env.rm(), 0x1000, UNCACHED);
addr_t phys = Dataspace_client(ds.cap()).phys_addr();
_setup_idmac_descriptor_table(1, phys);

View File

@ -160,8 +160,9 @@ class Sd_card::Driver : public Driver_base,
struct Timer_delayer : Timer::Connection, Mmio::Delayer
{
void usleep(unsigned us) {
Timer::Connection::usleep(us); }
Timer_delayer(Genode::Env &env) : Timer::Connection(env) { }
void usleep(unsigned us) { Timer::Connection::usleep(us); }
};
struct Block_transfer
@ -171,12 +172,12 @@ class Sd_card::Driver : public Driver_base,
};
Env &_env;
Timer_delayer _delayer;
Timer_delayer _delayer { _env };
Block_transfer _block_transfer;
Clock_regulator _clock_regulator { _env };
Signal_handler<Driver> _irq_handler { _env.ep(), *this, &Driver::_handle_irq };
Irq_connection _irq { Exynos5::SDMMC0_IRQ };
Attached_ram_dataspace _idmac_desc_ds { &_env.ram(),
Irq_connection _irq { _env, Exynos5::SDMMC0_IRQ };
Attached_ram_dataspace _idmac_desc_ds { _env.ram(), _env.rm(),
IDMAC_DESC_MAX_ENTRIES * sizeof(Idmac_desc),
UNCACHED };
Idmac_desc *const _idmac_desc { _idmac_desc_ds.local_addr<Idmac_desc>() };

View File

@ -200,6 +200,8 @@ class Sd_card::Driver : public Driver_base,
struct Timer_delayer : Timer::Connection, Mmio::Delayer
{
Timer_delayer(Genode::Env &env) : Timer::Connection(env) { }
void usleep(unsigned us) { Timer::Connection::usleep(us); }
};
@ -212,12 +214,12 @@ class Sd_card::Driver : public Driver_base,
Env &_env;
Block_transfer _block_transfer;
Timer_delayer _delayer;
Timer_delayer _delayer { _env };
Signal_handler<Driver> _irq_handler { _env.ep(), *this,
&Driver::_handle_irq };
Irq_connection _irq;
Card_info _card_info { _init() };
Adma2::Table _adma2_table { _env.ram() };
Adma2::Table _adma2_table { _env.ram(), _env.rm() };
static bool _supported_host_version(Hostver::access_t hostver);
static void _watermark_level(Wml::access_t &wml);

View File

@ -124,7 +124,7 @@ Driver::Driver(Env &env)
:
Driver_base(env.ram()),
Attached_mmio(env, Imx53::SDHC_MMIO_BASE, Imx53::SDHC_MMIO_SIZE),
_env(env), _irq(Imx53::SDHC_IRQ)
_env(env), _irq(env, Imx53::SDHC_IRQ)
{
log("SD card detected");
log("capacity: ", card_info().capacity_mb(), " MiB");

View File

@ -122,7 +122,7 @@ Driver::Driver(Env &env)
:
Driver_base(env.ram()),
Attached_mmio(env, Imx6::SDHC_MMIO_BASE, Imx6::SDHC_MMIO_SIZE),
_env(env), _irq(Imx6::SDHC_IRQ)
_env(env), _irq(env, Imx6::SDHC_IRQ)
{
log("SD card detected");
log("capacity: ", card_info().capacity_mb(), " MiB");

View File

@ -387,7 +387,7 @@ Csd Driver::_read_csd()
Driver::Driver(Env &env)
:
Driver_base(env.ram()),
Attached_mmio(env, MMCHS1_MMIO_BASE, MMCHS1_MMIO_SIZE), _ep(env.ep())
Attached_mmio(env, MMCHS1_MMIO_BASE, MMCHS1_MMIO_SIZE), _env(env)
{
_irq.sigh(_irq_handler);
_irq.ack_irq();

View File

@ -160,14 +160,16 @@ class Sd_card::Driver : public Driver_base,
struct Timer_delayer : Timer::Connection, Mmio::Delayer
{
Timer_delayer(Genode::Env &env) : Timer::Connection(env) { }
void usleep(unsigned us) { Timer::Connection::usleep(us); }
};
Entrypoint &_ep;
Env &_env;
Block_transfer _block_transfer;
Timer_delayer _delayer;
Signal_handler<Driver> _irq_handler { _ep, *this, &Driver::_handle_irq };
Irq_connection _irq { Panda::HSMMC_IRQ };
Timer_delayer _delayer { _env };
Signal_handler<Driver> _irq_handler { _env.ep(), *this, &Driver::_handle_irq };
Irq_connection _irq { _env, Panda::HSMMC_IRQ };
Card_info _card_info { _init() };
Card_info _init();

View File

@ -31,7 +31,7 @@ void Driver::_write_command(unsigned cmd_index, bool resp)
_write_reg(Command, cmd_index);
while (!_read_reg(Status) & (CmdRespEnd | CmdSent)) ;
while (!(_read_reg(Status) & (CmdRespEnd | CmdSent))) ;
}

View File

@ -25,7 +25,7 @@ Driver::Driver(Env &env)
:
Driver_base(env.ram()),
Attached_mmio(env, Rpi::SDHCI_BASE, Rpi::SDHCI_SIZE),
_ram(env.ram())
_env(env)
{
log("SD card detected");
log("capacity: ", _card_info.capacity_mb(), " MiB");
@ -40,7 +40,9 @@ void Driver::_set_and_enable_clock(unsigned divider)
Control1::Clk_internal_en::set(ctl1, 1);
Mmio::write<Control1>(ctl1);
if (!wait_for<Control1::Clk_internal_stable>(1, _delayer)) {
try {
wait_for(_delayer, Control1::Clk_internal_stable::Equal(1));
} catch (Polling_timeout) {
error("could not set internal clock");
throw Detection_failed();
}
@ -60,7 +62,9 @@ Card_info Driver::_init()
Control1::Srst_data::set(v);
Mmio::write<Control1>(v);
if (!wait_for<Control1::Srst_hc>(0, _delayer)) {
try {
wait_for(_delayer, Control1::Srst_hc::Equal(0));
} catch (Polling_timeout) {
error("host-controller soft reset timed out");
throw Detection_failed();
}

View File

@ -150,12 +150,14 @@ class Sd_card::Driver : public Driver_base,
struct Timer_delayer : Timer::Connection, Mmio::Delayer
{
Timer_delayer(Genode::Env &env) : Timer::Connection(env) { }
void usleep(unsigned us) { Timer::Connection::usleep(us); }
};
Ram_session &_ram;
Timer_delayer _delayer;
Irq_connection _irq { Rpi::SDHCI_IRQ };
Env &_env;
Timer_delayer _delayer { _env };
Irq_connection _irq { _env, Rpi::SDHCI_IRQ };
Card_info _card_info { _init() };
template <typename REG>
@ -212,7 +214,7 @@ class Sd_card::Driver : public Driver_base,
Block::Packet_descriptor &packet) override;
Ram_dataspace_capability alloc_dma_buffer(size_t size) override {
return _ram.alloc(size, UNCACHED); }
return _env.ram().alloc(size, UNCACHED); }
};
#endif /* _DRIVER_H_ */

View File

@ -60,7 +60,7 @@ struct Main
.xml().attribute_value("buffer_size_kib",
(size_t)0) };
size_t const buf_size { buf_size_kib * 1024 };
Attached_ram_dataspace buf { &env.ram(), buf_size, UNCACHED };
Attached_ram_dataspace buf { env.ram(), env.rm(), buf_size, UNCACHED };
char *buf_virt { buf.local_addr<char>() };
addr_t buf_phys { Dataspace_client(buf.cap())
.phys_addr() };