r0p7734.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  4. * Copyright (C) 2011 Renesas Solutions Corp.
  5. */
  6. #include <common.h>
  7. #include <asm/io.h>
  8. #include <asm/processor.h>
  9. #include <netdev.h>
  10. #include <i2c.h>
  11. #define MODEMR (0xFFCC0020)
  12. #define MODEMR_MASK (0x6)
  13. #define MODEMR_533MHZ (0x2)
  14. int checkboard(void)
  15. {
  16. u32 r = readl(MODEMR);
  17. if ((r & MODEMR_MASK) & MODEMR_533MHZ)
  18. puts("CPU Clock: 533MHz\n");
  19. else
  20. puts("CPU Clock: 400MHz\n");
  21. puts("BOARD: Renesas Technology Corp. R0P7734C00000RZ\n");
  22. return 0;
  23. }
  24. #define MSTPSR1 (0xFFC80044)
  25. #define MSTPCR1 (0xFFC80034)
  26. #define MSTPSR1_GETHER (1 << 14)
  27. int board_init(void)
  28. {
  29. #if defined(CONFIG_SH_ETHER)
  30. u32 r = readl(MSTPSR1);
  31. if (r & MSTPSR1_GETHER)
  32. writel((r & ~MSTPSR1_GETHER), MSTPCR1);
  33. #endif
  34. return 0;
  35. }
  36. int board_late_init(void)
  37. {
  38. printf("Cannot get MAC address from I2C\n");
  39. return 0;
  40. }
  41. #ifdef CONFIG_SMC911X
  42. int board_eth_init(bd_t *bis)
  43. {
  44. int rc = 0;
  45. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  46. return rc;
  47. }
  48. #endif