rsk7264.c 1.4 KB

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