mirror of
git://projects.qi-hardware.com/f32xbase.git
synced 2024-11-24 01:44:59 +02:00
e614d15fef
- f32x/c2-ben.c: removed #include <stdio.h> left over from debugging - f32x/f32x.c (main): command-line parsing now uses getopt() and is done before trying to talk to the target - f32x/c2-drv.h (c2_ops), f32x/c2.h (c2_init), f32x/c2.c (c2_init), f32x/c2-om.c (om_init): pass "power" argument along the init call chain - f32x/c2-ben.c (ben_init): added target power switching - f32x/f32x.c (usage, main): new option -n to disable target power
45 lines
931 B
C
45 lines
931 B
C
/*
|
|
* f32x/c2-om.c - Basic C2 messages, driver for Openmoko GTA01/GTA02+DebugV3
|
|
*
|
|
* Written 2008, 2010 by Werner Almesberger
|
|
* Copyright 2008, 2010 Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
|
|
#include "gpio-s3c24xx.h"
|
|
#include "c2-drv.h"
|
|
|
|
|
|
/*
|
|
* SPI GPIOs are the same on 2410 and 2442, so this should work on GTA01 and
|
|
* on GTA02.
|
|
*/
|
|
|
|
#define C2CK 4, 11 /* E13 = SPI_MISO0 */
|
|
#define C2D 4, 13 /* E12 = SPI_CLK0 */
|
|
|
|
|
|
#include "c2-bitbang.c"
|
|
|
|
|
|
static void om_init(int power)
|
|
{
|
|
gpio_init();
|
|
c2_init();
|
|
}
|
|
|
|
|
|
struct c2_ops c2_om = {
|
|
.init = om_init,
|
|
.reset = c2_reset,
|
|
.addr_write = c2_addr_write,
|
|
.addr_read = c2_addr_read,
|
|
.data_write = c2_data_write,
|
|
.data_read = c2_data_read,
|
|
};
|