rsk7203.c 1.3 KB

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