rsk7203.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2008 Nobuhiro Iwamatsu
  3. * Copyright (C) 2008 Renesas Solutions Corp.
  4. *
  5. * u-boot/board/rsk7203/rsk7203.c
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #include <common.h>
  10. #include <net.h>
  11. #include <netdev.h>
  12. #include <asm/io.h>
  13. #include <asm/processor.h>
  14. int checkboard(void)
  15. {
  16. puts("BOARD: Renesas Technology RSK7203\n");
  17. return 0;
  18. }
  19. int board_init(void)
  20. {
  21. return 0;
  22. }
  23. void led_set_state(unsigned short value)
  24. {
  25. }
  26. /*
  27. * The RSK board has the SMSC9118 wired up 'incorrectly'.
  28. * Byte-swapping is necessary, and so poor performance is inevitable.
  29. * This problem cannot evade by the swap function of CHIP, this can
  30. * evade by software Byte-swapping.
  31. * And this has problem by FIFO access only. pkt_data_pull/pkt_data_push
  32. * functions necessary to solve this problem.
  33. */
  34. u32 pkt_data_pull(struct eth_device *dev, u32 addr)
  35. {
  36. volatile u16 *addr_16 = (u16 *)(dev->iobase + addr);
  37. return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\
  38. | swab16(*(addr_16 + 1));
  39. }
  40. void pkt_data_push(struct eth_device *dev, u32 addr, u32 val)
  41. {
  42. addr += dev->iobase;
  43. *(volatile u16 *)(addr + 2) = swab16((u16)val);
  44. *(volatile u16 *)(addr) = swab16((u16)(val >> 16));
  45. }
  46. int board_eth_init(bd_t *bis)
  47. {
  48. int rc = 0;
  49. #ifdef CONFIG_SMC911X
  50. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  51. #endif
  52. return rc;
  53. }