shmin.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2007 - 2010
  3. * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  4. * (C) Copyright 2000-2003
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  7. *
  8. * board/shmin/shmin.c
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. *
  12. * Copy board_flash_get_legacy() from board/freescale/m54455evb/m54455evb.c
  13. */
  14. #include <common.h>
  15. #include <asm/io.h>
  16. #include <asm/processor.h>
  17. #include <netdev.h>
  18. int checkboard(void)
  19. {
  20. puts("BOARD: T-SH7706LAN ");
  21. if(readb(0xb0008006) == 0xab)
  22. puts("v2\n");
  23. else
  24. puts("v1\n");
  25. return 0;
  26. }
  27. int board_init(void)
  28. {
  29. writew(0x2980, BCR2);
  30. return 0;
  31. }
  32. int board_eth_init(bd_t *bis)
  33. {
  34. return ne2k_register();
  35. }
  36. void led_set_state(unsigned short value)
  37. {
  38. }
  39. #if defined(CONFIG_FLASH_CFI_LEGACY)
  40. #include <flash.h>
  41. ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
  42. {
  43. int sect[] = CONFIG_SYS_ATMEL_SECT;
  44. int sectsz[] = CONFIG_SYS_ATMEL_SECTSZ;
  45. int i, j, k;
  46. if (base != CONFIG_SYS_ATMEL_BASE)
  47. return 0;
  48. info->flash_id = 0x01000000;
  49. info->portwidth = 1;
  50. info->chipwidth = 1;
  51. info->buffer_size = 1;
  52. info->erase_blk_tout = 16384;
  53. info->write_tout = 2;
  54. info->buffer_write_tout = 5;
  55. info->vendor = 0xFFF0; /* CFI_CMDSET_AMD_LEGACY */
  56. info->cmd_reset = 0x00F0;
  57. info->interface = FLASH_CFI_X8;
  58. info->legacy_unlock = 0;
  59. info->manufacturer_id = (u16) ATM_MANUFACT;
  60. info->device_id = ATM_ID_LV040;
  61. info->device_id2 = 0;
  62. info->ext_addr = 0;
  63. info->cfi_version = 0x3133;
  64. info->cfi_offset = 0x0000;
  65. info->addr_unlock1 = 0x00000555;
  66. info->addr_unlock2 = 0x000002AA;
  67. info->name = "CFI conformant";
  68. info->size = 0;
  69. info->sector_count = CONFIG_SYS_ATMEL_TOTALSECT;
  70. info->start[0] = base;
  71. for (k = 0, i = 0; i < CONFIG_SYS_ATMEL_REGION; i++) {
  72. info->size += sect[i] * sectsz[i];
  73. for (j = 0; j < sect[i]; j++, k++) {
  74. info->start[k + 1] = info->start[k] + sectsz[i];
  75. info->protect[k] = 0;
  76. }
  77. }
  78. return 1;
  79. }
  80. #endif /* CONFIG_FLASH_CFI_LEGACY */