diff options
| author | wdenk <wdenk> | 2005-03-14 13:14:58 +0000 | 
|---|---|---|
| committer | wdenk <wdenk> | 2005-03-14 13:14:58 +0000 | 
| commit | a0bdf49e399e9e25e71081c5b3e73fc56c63a236 (patch) | |
| tree | 9267533169022c0629e259db22382d4471cf2edb | |
| parent | e9684a536a6769475b0b8cbac8b443e9acba9d60 (diff) | |
| download | olio-uboot-2014.01-a0bdf49e399e9e25e71081c5b3e73fc56c63a236.tar.xz olio-uboot-2014.01-a0bdf49e399e9e25e71081c5b3e73fc56c63a236.zip | |
INKA4x0: Allow initialization of LCD backlight dimming from
"brightness" environment variable.
| -rw-r--r-- | CHANGELOG | 3 | ||||
| -rw-r--r-- | board/inka4x0/inka4x0.c | 15 | ||||
| -rw-r--r-- | include/configs/inka4x0.h | 1 | ||||
| -rw-r--r-- | include/mpc5xxx.h | 1 | 
4 files changed, 20 insertions, 0 deletions
| @@ -5,6 +5,9 @@ Changes for U-Boot 1.1.3:  * Patch by Stefan Roese, 14 March 2005:    Update for esd voh405 fpga image +* INKA4x0: Allow initialization of LCD backlight dimming from +  "brightness" environment variable. +  * Add port initialization for digital I/O on INKA4x0  * Patch by Stefan Roese, 01 March 2005: diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c index f5e32cc58..c17b8feb4 100644 --- a/board/inka4x0/inka4x0.c +++ b/board/inka4x0/inka4x0.c @@ -177,6 +177,16 @@ void flash_preinit(void)  int misc_init_f (void)  { +	uchar tmp[10]; +	int i, br; + +	i = getenv_r("brightness", tmp, sizeof(tmp)); +	br = (i > 0) +		? (int) simple_strtoul (tmp, NULL, 10) +		: CFG_BRIGHTNESS; +	if (br > 255) +		br = 255; +  	/* Initialize GPIO output pins.  	 */  	/* Configure GPT as GPIO output */ @@ -187,6 +197,11 @@ int misc_init_f (void)  	*(vu_long *)MPC5XXX_GPT4_ENABLE =  	*(vu_long *)MPC5XXX_GPT5_ENABLE = 0x24; +	/* Configure GPT7 as PWM timer, 1kHz, no ints. */ +	*(vu_long *)MPC5XXX_GPT7_ENABLE = 0;/* Disable */ +	*(vu_long *)MPC5XXX_GPT7_COUNTER = 0x020000fe; +	*(vu_long *)MPC5XXX_GPT7_PWMCFG = (br << 16); +	*(vu_long *)MPC5XXX_GPT7_ENABLE = 0x3;/* Enable PWM mode and start */  	/* Configure PSC3_6,7 as GPIO output */  	*(vu_long *)MPC5XXX_GPIO_ENABLE |= 0x00003000; diff --git a/include/configs/inka4x0.h b/include/configs/inka4x0.h index c817d2c3a..9e98e6307 100644 --- a/include/configs/inka4x0.h +++ b/include/configs/inka4x0.h @@ -324,5 +324,6 @@  #define CFG_ATA_STRIDE          4  #define CONFIG_ATAPI            1 +#define CFG_BRIGHTNESS          0x20  #endif /* __CONFIG_H */ diff --git a/include/mpc5xxx.h b/include/mpc5xxx.h index 565e1cf02..887dc3ea0 100644 --- a/include/mpc5xxx.h +++ b/include/mpc5xxx.h @@ -248,6 +248,7 @@  #define MPC5XXX_GPT7_ENABLE		(MPC5XXX_GPT + 0x70)  #define MPC5XXX_GPT7_COUNTER		(MPC5XXX_GPT + 0x74) +#define MPC5XXX_GPT7_PWMCFG		(MPC5XXX_GPT + 0x78)  /* ATA registers */  #define MPC5XXX_ATA_HOST_CONFIG         (MPC5XXX_ATA + 0x0000) |