Commit 2ff69222 authored by Wolfgang Denk's avatar Wolfgang Denk

Merge branch 'master' of git://git.denx.de/u-boot-arm

parents f8b365ce 06f95959
......@@ -155,3 +155,34 @@ int davinci_configure_pin_mux(const struct pinmux_config *pins,
return 0;
}
/*
* Configure multiple pinmux resources.
*
* Takes an pinmux_resource array of pinmux_config and pin counts:
*
* const struct pinmux_resource pinmuxes[] = {
* PINMUX_ITEM(uart_pins),
* PINMUX_ITEM(i2c_pins),
* };
*
* The number of items in the array must be passed (ARRAY_SIZE can provide
* this value conveniently).
*
* Each item entry is configured in the defined order. If configuration
* of any item fails, -1 is returned and none of the following items are
* configured. On success, 0 is returned.
*/
int davinci_configure_pin_mux_items(const struct pinmux_resource *item,
const int n_items)
{
int i;
for (i = 0; i < n_items; i++) {
if (davinci_configure_pin_mux(item[i].pins,
item[i].n_pins) != 0)
return -1;
}
return 0;
}
......@@ -34,8 +34,21 @@ struct pinmux_config {
unsigned char field; /* field number */
};
/* pin table definition */
struct pinmux_resource {
const struct pinmux_config *pins;
const int n_pins;
};
#define PINMUX_ITEM(item) { \
.pins = item, \
.n_pins = ARRAY_SIZE(item) \
}
int dvevm_read_mac_address(uint8_t *buf);
void dv_configure_mac_address(uint8_t *rom_enetaddr);
int davinci_configure_pin_mux(const struct pinmux_config *pins, int n_pins);
int davinci_configure_pin_mux_items(const struct pinmux_resource *item,
int n_items);
#endif /* __MISC_H */
......@@ -63,7 +63,7 @@ int board_init(void)
int misc_init_r(void)
{
twl4030_power_init();
twl4030_led_init();
twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
dieid_num_r();
/*
......
......@@ -149,7 +149,7 @@ int misc_init_r(void)
{
zoom2_identify();
twl4030_power_init();
twl4030_led_init();
twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
dieid_num_r();
/*
......
......@@ -67,7 +67,7 @@ int board_init(void)
int misc_init_r(void)
{
twl4030_power_init();
twl4030_led_init();
twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
#if defined(CONFIG_CMD_NET)
setup_net_chip();
......
......@@ -65,8 +65,7 @@ int misc_init_r(void)
struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
twl4030_power_init();
twl4030_led_init();
twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
/* Configure GPIOs to output */
writel(~(GPIO14 | GPIO15 | GPIO16 | GPIO23), &gpio1_base->oe);
......
......@@ -107,7 +107,7 @@ int misc_init_r(void)
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
twl4030_power_init();
twl4030_led_init();
twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
/* Configure GPIOs to output */
writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
......
......@@ -76,7 +76,7 @@ int misc_init_r(void)
twl4030_power_init();
#ifdef CONFIG_TWL4030_LED
twl4030_led_init();
twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
#endif
#ifdef CONFIG_DRIVER_DM9000
......
......@@ -34,19 +34,15 @@
#include <twl4030.h>
#define LEDAON (0x1 << 0)
#define LEDBON (0x1 << 1)
#define LEDAPWM (0x1 << 4)
#define LEDBPWM (0x1 << 5)
void twl4030_led_init(void)
void twl4030_led_init(unsigned char ledon_mask)
{
unsigned char byte;
/* enable LED */
byte = LEDBPWM | LEDAPWM | LEDBON | LEDAON;
/* LEDs need to have corresponding PWMs enabled */
if (ledon_mask & TWL4030_LED_LEDEN_LEDAON)
ledon_mask |= TWL4030_LED_LEDEN_LEDAPWM;
if (ledon_mask & TWL4030_LED_LEDEN_LEDBON)
ledon_mask |= TWL4030_LED_LEDEN_LEDBPWM;
twl4030_i2c_write_u8(TWL4030_CHIP_LED, byte,
twl4030_i2c_write_u8(TWL4030_CHIP_LED, ledon_mask,
TWL4030_LED_LEDEN);
}
......@@ -179,26 +179,21 @@ static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int c
static void nand_davinci_enable_hwecc(struct mtd_info *mtd, int mode)
{
int dummy;
u_int32_t val;
dummy = emif_regs->NANDF1ECC;
(void)readl(&(emif_regs->NANDFECC[CONFIG_SYS_NAND_CS - 2]));
/* FIXME: only chipselect 0 is supported for now */
emif_regs->NANDFCR |= 1 << 8;
val = readl(&emif_regs->NANDFCR);
val |= DAVINCI_NANDFCR_NAND_ENABLE(CONFIG_SYS_NAND_CS);
val |= DAVINCI_NANDFCR_1BIT_ECC_START(CONFIG_SYS_NAND_CS);
writel(val, &emif_regs->NANDFCR);
}
static u_int32_t nand_davinci_readecc(struct mtd_info *mtd, u_int32_t region)
{
u_int32_t ecc = 0;
if (region == 1)
ecc = emif_regs->NANDF1ECC;
else if (region == 2)
ecc = emif_regs->NANDF2ECC;
else if (region == 3)
ecc = emif_regs->NANDF3ECC;
else if (region == 4)
ecc = emif_regs->NANDF4ECC;
ecc = readl(&(emif_regs->NANDFECC[region - 1]));
return(ecc);
}
......@@ -320,8 +315,12 @@ static void nand_davinci_4bit_enable_hwecc(struct mtd_info *mtd, int mode)
* Start a new ECC calculation for reading or writing 512 bytes
* of data.
*/
val = (emif_regs->NANDFCR & ~(3 << 4)) | (1 << 12);
emif_regs->NANDFCR = val;
val = readl(&emif_regs->NANDFCR);
val &= ~DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK;
val |= DAVINCI_NANDFCR_NAND_ENABLE(CONFIG_SYS_NAND_CS);
val |= DAVINCI_NANDFCR_4BIT_ECC_SEL(CONFIG_SYS_NAND_CS);
val |= DAVINCI_NANDFCR_4BIT_ECC_START;
writel(val, &emif_regs->NANDFCR);
break;
case NAND_ECC_READSYN:
val = emif_regs->NAND4BITECC1;
......
......@@ -51,10 +51,7 @@ typedef struct {
dv_reg NANDFCR;
dv_reg NANDFSR;
u_int8_t RSVD1[8];
dv_reg NANDF1ECC;
dv_reg NANDF2ECC;
dv_reg NANDF3ECC;
dv_reg NANDF4ECC;
dv_reg NANDFECC[4];
u_int8_t RSVD2[60];
dv_reg NAND4BITECCLOAD;
dv_reg NAND4BITECC1;
......@@ -68,4 +65,12 @@ typedef struct {
} emif_registers;
typedef emif_registers *emifregs;
#define DAVINCI_NANDFCR_NAND_ENABLE(n) (1 << (n-2))
#define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK (3 << 4)
#define DAVINCI_NANDFCR_4BIT_ECC_SEL(n) ((n-2) << 4)
#define DAVINCI_NANDFCR_1BIT_ECC_START(n) (1 << (8 + (n-2)))
#define DAVINCI_NANDFCR_4BIT_ECC_START (1 << 12)
#define DAVINCI_NANDFCR_4BIT_CALC_START (1 << 13)
#endif
This diff is collapsed.
......@@ -185,10 +185,8 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "Apollon # "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "Apollon # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
......
......@@ -66,6 +66,7 @@
/* NAND: socketed, two chipselects, normally 2 GBytes */
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#define CONFIG_SYS_NAND_USE_FLASH_BBT
#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
#define CONFIG_SYS_NAND_PAGE_2K
......
......@@ -65,6 +65,7 @@
/* NAND */
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#define CONFIG_SYS_NAND_USE_FLASH_BBT
#define CONFIG_SYS_NAND_HW_ECC
......
......@@ -74,6 +74,7 @@
/* NAND: socketed, two chipselects, normally 2 GBytes */
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#define CONFIG_SYS_NAND_USE_FLASH_BBT
#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
#define CONFIG_SYS_NAND_PAGE_2K
......
......@@ -75,6 +75,7 @@
#define CONFIG_SYS_NO_FLASH
#ifdef CONFIG_SYS_USE_NAND
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#undef CONFIG_ENV_IS_IN_FLASH
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB */
......
......@@ -114,6 +114,7 @@
/*=====================*/
#ifdef CONFIG_SYS_USE_NAND
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#undef CONFIG_ENV_IS_IN_FLASH
#define CONFIG_SYS_NO_FLASH
#define CONFIG_ENV_IS_IN_NAND /* U-Boot env in NAND Flash */
......
......@@ -83,6 +83,7 @@
#undef CONFIG_ENV_IS_IN_FLASH
#define CONFIG_SYS_NO_FLASH
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#define CONFIG_ENV_IS_IN_NAND /* U-Boot env in NAND Flash */
#define CONFIG_ENV_SECT_SIZE 2048 /* Env sector Size */
#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
......
......@@ -78,6 +78,7 @@
#undef CONFIG_ENV_IS_IN_FLASH
#define CONFIG_SYS_NO_FLASH
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#define CONFIG_ENV_IS_IN_NAND /* U-Boot env in NAND Flash */
#define CONFIG_ENV_SECT_SIZE 2048 /* Env sector Size */
#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
......
......@@ -114,6 +114,7 @@
/*=====================*/
#ifdef CONFIG_SYS_USE_NAND
#define CONFIG_NAND_DAVINCI
#define CONFIG_SYS_NAND_CS 2
#undef CONFIG_ENV_IS_IN_FLASH
#define CONFIG_SYS_NO_FLASH
#define CONFIG_ENV_IS_IN_NAND /* U-Boot env in NAND Flash */
......
......@@ -164,14 +164,12 @@
/*
* Miscellaneous configurable options
*/
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#ifdef CONFIG_APTIX
#define V_PROMPT "OMAP2420 Aptix # "
# define CONFIG_SYS_PROMPT "OMAP2420 Aptix # "
#else
#define V_PROMPT "OMAP242x H4 # "
# define CONFIG_SYS_PROMPT "OMAP242x H4 # "
#endif
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
......
......@@ -230,12 +230,10 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "OMAP3 beagleboard.org # "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "OMAP3 beagleboard.org # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
......
......@@ -234,12 +234,10 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "OMAP3_EVM # "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "OMAP3_EVM # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
......
......@@ -200,12 +200,10 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "Overo # "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "Overo # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
......
......@@ -191,12 +191,10 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "Pandora # "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "Pandora # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
......
......@@ -267,12 +267,11 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "OMAP34XX SDP # "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "OMAP34XX SDP # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
......
......@@ -215,12 +215,10 @@
/*
* Miscellaneous configurable options
*/
#define V_PROMPT "OMAP3 Zoom1# "
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#define CONFIG_SYS_PROMPT V_PROMPT
#define CONFIG_SYS_PROMPT "OMAP3 Zoom1 # "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
......
......@@ -306,6 +306,10 @@
/* LED */
#define TWL4030_LED_LEDEN 0xEE
#define TWL4030_LED_LEDEN_LEDAON (1 << 0)
#define TWL4030_LED_LEDEN_LEDBON (1 << 1)
#define TWL4030_LED_LEDEN_LEDAPWM (1 << 4)
#define TWL4030_LED_LEDEN_LEDBPWM (1 << 5)
/* Keypad */
#define TWL4030_KEYPAD_KEYP_CTRL_REG 0xD2
......@@ -504,7 +508,7 @@ void twl4030_power_mmc_init(void);
/*
* LED
*/
void twl4030_led_init(void);
void twl4030_led_init(unsigned char ledon_mask);
/*
* USB
......
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