Commit 364eada4 authored by H. Nikolaus Schaller's avatar H. Nikolaus Schaller

fix compilation for GTA04b2 (Letux 3704)

Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
parent 2cdbad4a
......@@ -27,6 +27,7 @@
#include <asm/arch/mux.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/gpio.h>
#include <asm/gpio.h>
#include <asm/mach-types.h>
#include <twl4030.h>
#include "../letux-gta04/dssfb.h"
......@@ -34,17 +35,21 @@
#include "../letux-gta04/backlight.h"
#include "COM37H3M05DTC.h"
// FIXME: should go to board config
#ifndef CONFIG_GOLDELICO_EXPANDER_B2
#error only for B2 board
#endif
#ifdef CONFIG_OMAP3_GTA04
// FIXME: should go to board config
#ifdef CONFIG_TARGET_LETUX_GTA04_B2
#define GPIO_STBY 20
#elif CONFIG_OMAP3_BEAGLE
#elif CONFIG_TARGET_LETUX_BEAGLE_B2
#define GPIO_STBY 158
......@@ -97,8 +102,8 @@ static /*const*/ struct panel_config lcm_cfg =
int panel_reg_init(void)
{
omap_request_gpio(GPIO_STBY);
omap_set_gpio_direction(GPIO_STBY, 0); // output
gpio_request(GPIO_STBY, "panel-stby");
gpio_direction_output(GPIO_STBY, 0); // output
return 0;
}
......@@ -120,7 +125,7 @@ int panel_enter_state(enum panel_state new_state)
int panel_display_onoff(int on)
{
omap_set_gpio_dataout(GPIO_STBY, on?1:0); // on = no STBY
gpio_direction_output(GPIO_STBY, on?1:0); // on = no STBY
return 0;
}
......
obj-y := gta04b2.o COM37H3M05DTC.o trf7960.o ../letux-gta04/backlight.o ../letux-gta04/status.o ../letux-gta04/tsc2007.o ../letux-gta04/dssfb.o ../letux-gta04/gps.o ../letux-gta04/shutdown.o ../letux-gta04/systest.o ../letux-gta04/commands.o ../letux-gta04/ulpi-phy.o ../letux-gta04/twl4030-additions.o
obj-y := gta04b2.o
ifndef CONFIG_SPL_BUILD
obj-y += COM37H3M05DTC.o trf7960.o ../letux-gta04/backlight.o ../letux-gta04/status.o ../letux-gta04/tsc2007.o ../letux-gta04/dssfb.o ../letux-gta04/gps.o ../letux-gta04/shutdown.o ../letux-gta04/systest.o ../letux-gta04/commands.o ../letux-gta04/ulpi-phy.o ../letux-gta04/twl4030-additions.o
endif
\ No newline at end of file
......@@ -25,6 +25,7 @@
#include <command.h>
#include <spi.h>
#include <asm/arch/gpio.h>
#include <asm/gpio.h>
#include <malloc.h>
/* board specific configuration */
......@@ -147,11 +148,11 @@ static int bitbang_spi_xfer(struct spi_slave *slave, int bitlen, uchar writeBuff
uchar wb=0;
uchar rb=0;
if(first) { /* if not correctly done by pinmux */
omap_set_gpio_direction(McSPI3_CLK, 0);
omap_set_gpio_direction(McSPI3_SIMO, 0);
omap_set_gpio_direction(McSPI3_SOMI, 1);
omap_set_gpio_dataout(McSPI3_CLK, 0);
omap_set_gpio_dataout(McSPI3_SIMO, 0); /* send out constant 0 bits (idle command) */
gpio_direction_output(McSPI3_CLK, 0);
gpio_direction_output(McSPI3_SIMO, 0);
gpio_direction_input(McSPI3_SOMI);
gpio_direction_output(McSPI3_CLK, 0);
gpio_direction_output(McSPI3_SIMO, 0); /* send out constant 0 bits (idle command) */
first=0;
udelay(100);
}
......@@ -159,34 +160,34 @@ static int bitbang_spi_xfer(struct spi_slave *slave, int bitlen, uchar writeBuff
printf("bitbang_spi_xfer %d bits\n", bitlen);
#endif
if(flags & SPI_XFER_BEGIN) {
omap_set_gpio_dataout(McSPI3_CLK, 1);
gpio_direction_output(McSPI3_CLK, 1);
udelay(HALFBIT); /* may be optional (>50ns) */
omap_set_gpio_dataout(McSPI3_SIMO, 1); /* start condition (data transision while clock=1) */
gpio_direction_output(McSPI3_SIMO, 1); /* start condition (data transision while clock=1) */
udelay(HALFBIT);
}
omap_set_gpio_dataout(McSPI3_CLK, 0);
gpio_direction_output(McSPI3_CLK, 0);
for(bit=0; bit < bitlen; bit++)
{ /* write data */
if(bit%8 == 0)
wb=writeBuffer[bit/8];
omap_set_gpio_dataout(McSPI3_SIMO, (wb&0x80)?1:0); /* send MSB first */
gpio_direction_output(McSPI3_SIMO, (wb&0x80)?1:0); /* send MSB first */
wb <<= 1;
udelay(HALFBIT);
omap_set_gpio_dataout(McSPI3_CLK, 1);
gpio_direction_output(McSPI3_CLK, 1);
udelay(HALFBIT);
omap_set_gpio_dataout(McSPI3_CLK, 0);
rb = (rb<<1) | omap_get_gpio_datain(McSPI3_SOMI); /* sample on falling edge and receive MSB first */
gpio_direction_output(McSPI3_CLK, 0);
rb = (rb<<1) | gpio_get_value(McSPI3_SOMI); /* sample on falling edge and receive MSB first */
if(bit%8 == 7)
readBuffer[bit/8]=rb;
}
if(flags & SPI_XFER_END) {
omap_set_gpio_dataout(McSPI3_SIMO, 1); /* set data to 1 */
gpio_direction_output(McSPI3_SIMO, 1); /* set data to 1 */
udelay(HALFBIT);
omap_set_gpio_dataout(McSPI3_CLK, 1);
gpio_direction_output(McSPI3_CLK, 1);
udelay(HALFBIT);
omap_set_gpio_dataout(McSPI3_SIMO, 0); /* stop condition (data transision while clock=1) */
gpio_direction_output(McSPI3_SIMO, 0); /* stop condition (data transision while clock=1) */
udelay(HALFBIT); /* may be optional (>50ns) */
omap_set_gpio_dataout(McSPI3_CLK, 0);
gpio_direction_output(McSPI3_CLK, 0);
udelay(HALFBIT);
}
return 0;
......@@ -283,7 +284,7 @@ int prepareIrq(struct trf7960 *device, uchar *data, unsigned int bytes)
}
#endif
#if 0
while(device->irq >= 0 && omap_get_gpio_datain(device->irq)) {
while(device->irq >= 0 && gpio_get_value(device->irq)) {
printf("prepareIrq: IRQ pin already active!\n");
resetIRQ(device);
}
......@@ -403,7 +404,7 @@ void waitIrq(struct trf7960 *device)
#endif
if(device->irq >= 0) { /* check IRQ pin */
int cnt=2000; // software timeout
while(!omap_get_gpio_datain(device->irq) && cnt-- > 0)
while(!gpio_get_value(device->irq) && cnt-- > 0)
udelay(500); /* wait for IRQ pin */
handleInterrupt(device);
}
......@@ -425,32 +426,32 @@ int setPowerMode(struct trf7960 *device, int mode)
if(mode < TRF7960_POWER_DOWN || mode > TRF7960_POWER_RXTX_FULL)
return -1;
if(device->en >= 0)
omap_set_gpio_direction(device->en, 0); /* make output */
gpio_direction_output(device->en, 0); /* make output */
if(device->en2 >= 0)
omap_set_gpio_direction(device->en2, 0); /* make output */
gpio_direction_output(device->en2, 0); /* make output */
if(device->irq >= 0)
omap_set_gpio_direction(device->irq, 1); /* make input */
gpio_direction_output(device->irq, 1); /* make input */
if(mode == TRF7960_POWER_DOWN) {
if(device->slave) {
spi_free_slave(device->slave);
device->slave = NULL;
}
if(device->en >= 0)
omap_set_gpio_dataout(device->en, 0);
gpio_direction_output(device->en, 0);
if(device->en2 >= 0 && device->en != device->en2)
omap_set_gpio_dataout(device->en2, 0); /* not tied togehter */
gpio_direction_output(device->en2, 0); /* not tied togehter */
}
else if(mode == TRF7960_POWER_60kHz) {
if(device->en >= 0 && device->en2 >= 0 && device->en == device->en2)
return -1; /* can't control them separately */
if(device->en >= 0)
omap_set_gpio_dataout(device->en, 0);
gpio_direction_output(device->en, 0);
if(device->en2 >= 0)
omap_set_gpio_dataout(device->en2, 1);
gpio_direction_output(device->en2, 1);
}
else {
if(device->en >= 0)
omap_set_gpio_dataout(device->en, 1);
gpio_direction_output(device->en, 1);
if(!device->slave) {
device->slave = spi_setup_slave(device->bus, device->cs, device->clock, SPI_MODE_0);
if(!device->slave)
......@@ -789,7 +790,6 @@ static void found(struct trf7960 *device, uint64_t uid, int rssi)
static int do_rfid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
int len;
static int statusinit;
extern void status_set_status(int value);
extern int status_init(void);
......@@ -804,10 +804,9 @@ static int do_rfid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
statusinit=1;
}
len = strlen (argv[1]);
if (strncmp ("po", argv[1], 2) == 0) {
return setPowerMode(&rfid_board, simple_strtoul(argv[2], NULL, 10)) < 0?1:0;
#if 1
} else if (strncmp ("re", argv[1], 2) == 0) {
int r;
......@@ -848,7 +847,7 @@ static int do_rfid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
printf("Invalid bitlen %d\n", bitlen);
return 1;
}
if(spi_xfer(rfid_board.slave, bitlen, dout, din,
SPI_XFER_BEGIN | SPI_XFER_END) != 0) {
printf("Error during SPI transaction\n");
......@@ -858,7 +857,8 @@ static int do_rfid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
printf("%02X", din[j]);
}
printf("\n");
}
}
return rcode;
#endif
} else if (strncmp ("sc", argv[1], 2) == 0) {
numfound=0;
......@@ -928,7 +928,7 @@ static int do_rfid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
} else {
printf ("rfid: unknown operation: %s\n", argv[1]);
}
return (0);
}
......
......@@ -3,5 +3,33 @@ CONFIG_OMAP34XX=y
CONFIG_TARGET_LETUX_GTA04_B2=y
CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="NAND"
CONFIG_VERSION_VARIABLE=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
CONFIG_CMD_ASKENV=y
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_MMC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_MUSB_GADGET=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="Goldelico"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_OF_LIBFDT=y
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment