shmin.c 2.0 KB

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