2012-12-10 13:34:42 +01:00
|
|
|
/*
|
|
|
|
* \brief Gpio driver for the i.MX53
|
|
|
|
* \author Ivan Loskutov <ivan.loskutov@ksyslabs.org>
|
|
|
|
* \author Nikolay Golikov <nik@ksyslabs.org>
|
2013-05-06 14:33:30 +02:00
|
|
|
* \author Stefan Kalkowski <stefan.kalkowski@genode-labs.com>
|
2012-12-10 13:34:42 +01:00
|
|
|
* \date 2012-12-09
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Ksys Labs LLC
|
2013-05-06 14:33:30 +02:00
|
|
|
* Copyright (C) 2012-2013 Genode Labs GmbH
|
2012-12-10 13:34:42 +01:00
|
|
|
*
|
|
|
|
* 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 <base/printf.h>
|
|
|
|
#include <base/sleep.h>
|
2013-05-06 14:33:30 +02:00
|
|
|
#include <cap_session/connection.h>
|
|
|
|
#include <gpio/component.h>
|
|
|
|
#include <gpio/config.h>
|
2012-12-10 13:34:42 +01:00
|
|
|
|
|
|
|
/* local includes */
|
2013-05-06 14:33:30 +02:00
|
|
|
#include <driver.h>
|
2012-12-10 13:34:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
int main(int, char **)
|
|
|
|
{
|
2013-05-06 14:33:30 +02:00
|
|
|
using namespace Genode;
|
2012-12-10 13:34:42 +01:00
|
|
|
|
|
|
|
printf("--- i.MX53 gpio driver ---\n");
|
|
|
|
|
2013-05-06 14:33:30 +02:00
|
|
|
Imx53_driver &driver = Imx53_driver::factory();
|
|
|
|
Gpio::process_config(driver);
|
2012-12-10 13:34:42 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize server entry point
|
|
|
|
*/
|
|
|
|
enum { STACK_SIZE = 4096 };
|
|
|
|
static Cap_connection cap;
|
2013-05-06 14:33:30 +02:00
|
|
|
Sliced_heap sliced_heap(env()->ram_session(), env()->rm_session());
|
2012-12-10 13:34:42 +01:00
|
|
|
static Rpc_entrypoint ep(&cap, STACK_SIZE, "gpio_ep");
|
2013-05-06 14:33:30 +02:00
|
|
|
static Gpio::Root gpio_root(&ep, &sliced_heap, driver);
|
2012-12-10 13:34:42 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Announce service
|
|
|
|
*/
|
|
|
|
env()->parent()->announce(ep.manage(&gpio_root));
|
|
|
|
|
|
|
|
Genode::sleep_forever();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|