rsk7269.c 1.4 KB

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