rsk7269.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. * This file is released under the terms of GPL v2 and any later version.
  10. * See the file COPYING in the root directory of the source tree for details.
  11. */
  12. #include <common.h>
  13. #include <net.h>
  14. #include <netdev.h>
  15. #include <asm/io.h>
  16. #include <asm/processor.h>
  17. DECLARE_GLOBAL_DATA_PTR;
  18. int checkboard(void)
  19. {
  20. puts("BOARD: Renesas RSK7269\n");
  21. return 0;
  22. }
  23. int board_init(void)
  24. {
  25. return 0;
  26. }
  27. int dram_init(void)
  28. {
  29. gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  30. gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
  31. printf("DRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
  32. return 0;
  33. }
  34. void led_set_state(unsigned short value)
  35. {
  36. }
  37. /*
  38. * The RSK board has the SMSC89218 wired up 'incorrectly'.
  39. * Byte-swapping is necessary, and so poor performance is inevitable.
  40. * This problem cannot evade by the swap function of CHIP, this can
  41. * evade by software Byte-swapping.
  42. * And this has problem by FIFO access only. pkt_data_pull/pkt_data_push
  43. * functions necessary to solve this problem.
  44. */
  45. u32 pkt_data_pull(struct eth_device *dev, u32 addr)
  46. {
  47. volatile u16 *addr_16 = (u16 *)(dev->iobase + addr);
  48. return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\
  49. | swab16(*(addr_16 + 1));
  50. }
  51. void pkt_data_push(struct eth_device *dev, u32 addr, u32 val)
  52. {
  53. addr += dev->iobase;
  54. *(volatile u16 *)(addr + 2) = swab16((u16)val);
  55. *(volatile u16 *)(addr) = swab16((u16)(val >> 16));
  56. }
  57. int board_eth_init(bd_t *bis)
  58. {
  59. int rc = 0;
  60. #ifdef CONFIG_SMC911X
  61. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  62. #endif
  63. return rc;
  64. }