mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 20:18:54 -04:00
Blackfin: bf533-stamp: convert eth/flash swap logic to gpio framework
Rather than bang MMRs directly, use the new portmux framework to handle the details. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
37a4b75d4c
commit
6cfcf5840b
@ -27,8 +27,7 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <netdev.h>
|
#include <netdev.h>
|
||||||
#include <asm/io.h>
|
#include <asm/gpio.h>
|
||||||
#include "bf533-stamp.h"
|
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
@ -46,15 +45,10 @@ int checkboard(void)
|
|||||||
*/
|
*/
|
||||||
void swap_to(int device_id)
|
void swap_to(int device_id)
|
||||||
{
|
{
|
||||||
bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF1 | PF0);
|
gpio_request(GPIO_PF0, "eth_flash_swap");
|
||||||
SSYNC();
|
gpio_request(GPIO_PF1, "eth_flash_swap");
|
||||||
bfin_write_FIO_FLAG_C(PF1);
|
gpio_direction_output(GPIO_PF0, device_id == ETHERNET);
|
||||||
if (device_id == ETHERNET)
|
gpio_direction_output(GPIO_PF1, 0);
|
||||||
bfin_write_FIO_FLAG_S(PF0);
|
|
||||||
else if (device_id == FLASH)
|
|
||||||
bfin_write_FIO_FLAG_C(PF0);
|
|
||||||
else
|
|
||||||
printf("Unknown device to switch\n");
|
|
||||||
SSYNC();
|
SSYNC();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,24 +69,23 @@ int misc_init_r(void)
|
|||||||
#define STATUS_LED_OFF 0
|
#define STATUS_LED_OFF 0
|
||||||
#define STATUS_LED_ON 1
|
#define STATUS_LED_ON 1
|
||||||
|
|
||||||
|
static int gpio_setup;
|
||||||
|
|
||||||
static void stamp_led_set(int LED1, int LED2, int LED3)
|
static void stamp_led_set(int LED1, int LED2, int LED3)
|
||||||
{
|
{
|
||||||
bfin_write_FIO_INEN(bfin_read_FIO_INEN() & ~(PF2 | PF3 | PF4));
|
if (!gpio_setup) {
|
||||||
bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (PF2 | PF3 | PF4));
|
gpio_request(GPIO_PF2, "boot_progress");
|
||||||
|
gpio_request(GPIO_PF3, "boot_progress");
|
||||||
if (LED1 == STATUS_LED_OFF)
|
gpio_request(GPIO_PF4, "boot_progress");
|
||||||
*pFIO_FLAG_S = PF2;
|
gpio_direction_output(GPIO_PF2, LED1);
|
||||||
else
|
gpio_direction_output(GPIO_PF3, LED2);
|
||||||
*pFIO_FLAG_C = PF2;
|
gpio_direction_output(GPIO_PF4, LED3);
|
||||||
if (LED2 == STATUS_LED_OFF)
|
gpio_setup = 1;
|
||||||
*pFIO_FLAG_S = PF3;
|
} else {
|
||||||
else
|
gpio_set_value(GPIO_PF2, LED1);
|
||||||
*pFIO_FLAG_C = PF3;
|
gpio_set_value(GPIO_PF3, LED2);
|
||||||
if (LED3 == STATUS_LED_OFF)
|
gpio_set_value(GPIO_PF4, LED3);
|
||||||
*pFIO_FLAG_S = PF4;
|
}
|
||||||
else
|
|
||||||
*pFIO_FLAG_C = PF4;
|
|
||||||
SSYNC();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_boot_progress(int status)
|
void show_boot_progress(int status)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user