Blackfin: blackstamp: 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
6cfcf5840b
commit
7d44f5ec9e
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <netdev.h>
|
#include <netdev.h>
|
||||||
#include <asm/io.h>
|
#include <asm/gpio.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
|
@ -27,14 +27,8 @@ int checkboard(void)
|
||||||
#ifdef SHARED_RESOURCES
|
#ifdef SHARED_RESOURCES
|
||||||
void swap_to(int device_id)
|
void swap_to(int device_id)
|
||||||
{
|
{
|
||||||
bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF0);
|
gpio_request(GPIO_PF0, "eth_flash_swap");
|
||||||
SSYNC();
|
gpio_direction_output(GPIO_PF0, device_id == ETHERNET);
|
||||||
if (device_id == ETHERNET)
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue