X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Fgdsys%2F405ep%2Fiocon.c;h=0fc7db2012c9ba52d0ff12d5f10a948999a7b4a7;hb=9a32084ea0cf55d22384f083002ee9932e074f31;hp=20770e4eff99a73e8efbcfa31019706ffe950622;hpb=fced09ae386d1aa7fcfdf9111c99da4be56e5b43;p=u-boot diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c index 20770e4eff..0fc7db2012 100644 --- a/board/gdsys/405ep/iocon.c +++ b/board/gdsys/405ep/iocon.c @@ -27,10 +27,15 @@ #include #include +#include "405ep.h" #include #include "../common/osd.h" +#define LATCH0_BASE (CONFIG_SYS_LATCH_BASE) +#define LATCH1_BASE (CONFIG_SYS_LATCH_BASE + 0x100) +#define LATCH2_BASE (CONFIG_SYS_LATCH_BASE + 0x200) + enum { UNITTYPE_MAIN_SERVER = 0, UNITTYPE_MAIN_USER = 1, @@ -69,8 +74,25 @@ enum { */ int checkboard(void) { - ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0); char *s = getenv("serial#"); + + puts("Board: "); + + puts("IoCon"); + + if (s != NULL) { + puts(", serial# "); + puts(s); + } + + puts("\n"); + + return 0; +} + +static void print_fpga_info(void) +{ + struct ihs_fpga *fpga = (struct ihs_fpga *) CONFIG_SYS_FPGA_BASE(0); u16 versions = in_le16(&fpga->versions); u16 fpga_version = in_le16(&fpga->fpga_version); u16 fpga_features = in_le16(&fpga->fpga_features); @@ -94,16 +116,6 @@ int checkboard(void) feature_carriers = (fpga_features & 0x000c) >> 2; feature_video_channels = fpga_features & 0x0003; - printf("Board: "); - - printf("IoCon"); - - if (s != NULL) { - puts(", serial# "); - puts(s); - } - puts("\n "); - switch (unit_type) { case UNITTYPE_MAIN_USER: printf("Mainchannel"); @@ -204,12 +216,12 @@ int checkboard(void) printf(", %d carrier(s)", feature_carriers); printf(", %d video channel(s)\n", feature_video_channels); - - return 0; } int last_stage_init(void) { + print_fpga_info(); + return osd_probe(0); } @@ -230,3 +242,32 @@ int fpga_gpio_get(int pin) { return in_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x14)) & pin; } + +void gd405ep_init(void) +{ +} + +void gd405ep_set_fpga_reset(unsigned state) +{ + if (state) { + out_le16((void *)LATCH0_BASE, CONFIG_SYS_LATCH0_RESET); + out_le16((void *)LATCH1_BASE, CONFIG_SYS_LATCH1_RESET); + } else { + out_le16((void *)LATCH0_BASE, CONFIG_SYS_LATCH0_BOOT); + out_le16((void *)LATCH1_BASE, CONFIG_SYS_LATCH1_BOOT); + } +} + +void gd405ep_setup_hw(void) +{ + /* + * set "startup-finished"-gpios + */ + gpio_write_bit(21, 0); + gpio_write_bit(22, 1); +} + +int gd405ep_get_fpga_done(unsigned fpga) +{ + return in_le16((void *)LATCH2_BASE) & CONFIG_SYS_FPGA_DONE(fpga); +}