os: re-enable drivers_interactive for i.MX53

* Fix IPU hardware structure layout
* Turn Signal_handler into Io_signal_handler
* Eliminate the faulty msleep in I2C initalization sequence
* Fix routes and resources for tablet board (i.MX53 SMD)

Fix #3735
This commit is contained in:
Stefan Kalkowski 2020-04-22 11:18:41 +02:00 committed by Norman Feske
parent 840f383e46
commit 199821a247
8 changed files with 23 additions and 23 deletions

View File

@ -69,10 +69,13 @@
</route>
</start>
<start name="imx53_input_drv" caps="70">
<start name="imx53_input_drv" caps="100">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Input"/> </provides>
<route>
<service name="IO_MEM"> <parent/> </service>
<service name="IRQ"> <parent/> </service>
<service name="Gpio"> <child name="imx53_gpio_drv"/> </service>
<service name="Platform"> <child name="platform_drv"/> </service>
<service name="ROM"> <parent/> </service>
<service name="PD"> <parent/> </service>

View File

@ -207,7 +207,7 @@ class Ipu : Genode::Mmio
unsigned dec_sel2 : 1; /* Decode Address Select bit[2] */
unsigned res2 : 9; /* reserved */
Genode::uint32_t res3[3];
};
} __attribute__((packed));
Cp_mem() { Genode::memset(this, 0, sizeof(Cp_mem)); }
} __attribute__((packed));

View File

@ -68,7 +68,7 @@ class Imx_driver : public Gpio::Driver
Irq_handler &operator = (Irq_handler const &);
Genode::Irq_connection _irq;
Genode::Signal_handler<Irq_handler> _dispatcher;
Genode::Io_signal_handler<Irq_handler> _dispatcher;
Gpio_bank *_bank;
void _handle()

View File

@ -37,14 +37,13 @@ class Input::Tablet_driver
GPIO_BUTTON = 132,
};
Timer::Connection _timer;
Event_queue &_ev_queue;
Gpio::Connection _gpio_ts;
Gpio::Connection _gpio_bt;
Genode::Irq_session_client _irq_ts;
Genode::Irq_session_client _irq_bt;
Genode::Signal_handler<Tablet_driver> _ts_dispatcher;
Genode::Signal_handler<Tablet_driver> _bt_dispatcher;
Genode::Io_signal_handler<Tablet_driver> _ts_dispatcher;
Genode::Io_signal_handler<Tablet_driver> _bt_dispatcher;
Touchscreen _touchscreen;
Buttons _buttons;
@ -62,7 +61,6 @@ class Input::Tablet_driver
Tablet_driver(Genode::Env &env, Event_queue &ev_queue)
:
_timer(env),
_ev_queue(ev_queue),
_gpio_ts(env, GPIO_TOUCH),
_gpio_bt(env, GPIO_BUTTON),
@ -70,7 +68,8 @@ class Input::Tablet_driver
_irq_bt(_gpio_bt.irq_session(Gpio::Session::FALLING_EDGE)),
_ts_dispatcher(env.ep(), *this, &Tablet_driver::_handle_ts),
_bt_dispatcher(env.ep(), *this, &Tablet_driver::_handle_bt),
_touchscreen(env, _timer), _buttons(env, _timer)
_touchscreen(env),
_buttons(env)
{
/* GPIO touchscreen handling */
_gpio_ts.direction(Gpio::Session::OUT);

View File

@ -44,12 +44,11 @@ class Input::Touchscreen {
public:
Touchscreen(Genode::Env &env, Timer::Connection &timer)
Touchscreen(Genode::Env &env)
:
_irq_handler(env, Imx53::I2C_3_IRQ),
_i2c_ds(env, Imx53::I2C_3_BASE, Imx53::I2C_3_SIZE),
_i2c(timer,
(Genode::addr_t)_i2c_ds.local_addr<void>(),
_i2c((Genode::addr_t)_i2c_ds.local_addr<void>(),
_irq_handler),
_state(RELEASED)
{

View File

@ -64,8 +64,7 @@ class I2c::I2c : Genode::Mmio
class No_ack : Genode::Exception {};
Timer::Connection &_timer;
Irq_handler &_irq_handler;
Irq_handler & _irq_handler;
void _busy() { while (!read<Status::Busy>()); }
@ -77,7 +76,7 @@ class I2c::I2c : Genode::Mmio
write<Status>(0);
write<Control>(Control::Enable::bits(1));
_timer.msleep(1);
while (!read<Control::Enable>()) { ; }
write<Control::Master_slave_select>(1);
@ -112,9 +111,9 @@ class I2c::I2c : Genode::Mmio
public:
I2c(Timer::Connection &timer,
Genode::addr_t const base, Irq_handler &irq_handler)
: Mmio(base), _timer(timer), _irq_handler(irq_handler)
I2c(Genode::addr_t const base, Irq_handler &irq_handler)
: Mmio(base),
_irq_handler(irq_handler)
{
write<Control>(0);
write<Status>(0);
@ -167,6 +166,7 @@ class I2c::I2c : Genode::Mmio
}
buf[i] = read<Data>();
_irq_handler.ack();
}
_stop();

View File

@ -21,9 +21,9 @@ class Irq_handler
{
private:
Genode::Env &_env;
Genode::Irq_connection _irq;
Genode::Signal_handler<Irq_handler> _handler;
Genode::Env &_env;
Genode::Irq_connection _irq;
Genode::Io_signal_handler<Irq_handler> _handler;
unsigned _sem_cnt = 1;

View File

@ -52,12 +52,11 @@ class Input::Buttons {
public:
Buttons(Genode::Env &env, Timer::Connection &timer)
Buttons(Genode::Env &env)
:
_irq_handler(env, Imx53::I2C_2_IRQ),
_i2c_ds(env, Imx53::I2C_2_BASE, Imx53::I2C_2_SIZE),
_i2c(timer,
(Genode::addr_t)_i2c_ds.local_addr<void>(),
_i2c((Genode::addr_t)_i2c_ds.local_addr<void>(),
_irq_handler),
_state(0)
{