cpci750.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104
  1. /*
  2. * (C) Copyright 2001
  3. * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. *
  23. * modifications for the DB64360 eval board based by Ingo.Assmus@keymile.com
  24. * modifications for the cpci750 by reinhard.arlt@esd-electronics.com
  25. */
  26. /*
  27. * cpci750.c - main board support/init for the esd cpci750.
  28. */
  29. #include <common.h>
  30. #include <command.h>
  31. #include <74xx_7xx.h>
  32. #include "../../Marvell/include/memory.h"
  33. #include "../../Marvell/include/pci.h"
  34. #include "../../Marvell/include/mv_gen_reg.h"
  35. #include <net.h>
  36. #include "eth.h"
  37. #include "mpsc.h"
  38. #include "i2c.h"
  39. #include "64360.h"
  40. #include "mv_regs.h"
  41. #undef DEBUG
  42. /*#define DEBUG */
  43. #ifdef CONFIG_PCI
  44. #define MAP_PCI
  45. #endif /* of CONFIG_PCI */
  46. #ifdef DEBUG
  47. #define DP(x) x
  48. #else
  49. #define DP(x)
  50. #endif
  51. static char show_config_tab[][15] = {{"PCI0DLL_2 "}, /* 31 */
  52. {"PCI0DLL_1 "}, /* 30 */
  53. {"PCI0DLL_0 "}, /* 29 */
  54. {"PCI1DLL_2 "}, /* 28 */
  55. {"PCI1DLL_1 "}, /* 27 */
  56. {"PCI1DLL_0 "}, /* 26 */
  57. {"BbEP2En "}, /* 25 */
  58. {"SDRAMRdDataDel"}, /* 24 */
  59. {"SDRAMRdDel "}, /* 23 */
  60. {"SDRAMSync "}, /* 22 */
  61. {"SDRAMPipeSel_1"}, /* 21 */
  62. {"SDRAMPipeSel_0"}, /* 20 */
  63. {"SDRAMAddDel "}, /* 19 */
  64. {"SDRAMClkSel "}, /* 18 */
  65. {"Reserved(1!) "}, /* 17 */
  66. {"PCIRty "}, /* 16 */
  67. {"BootCSWidth_1 "}, /* 15 */
  68. {"BootCSWidth_0 "}, /* 14 */
  69. {"PCI1PadsCal "}, /* 13 */
  70. {"PCI0PadsCal "}, /* 12 */
  71. {"MultiMVId_1 "}, /* 11 */
  72. {"MultiMVId_0 "}, /* 10 */
  73. {"MultiGTEn "}, /* 09 */
  74. {"Int60xArb "}, /* 08 */
  75. {"CPUBusConfig_1"}, /* 07 */
  76. {"CPUBusConfig_0"}, /* 06 */
  77. {"DefIntSpc "}, /* 05 */
  78. {0 }, /* 04 */
  79. {"SROMAdd_1 "}, /* 03 */
  80. {"SROMAdd_0 "}, /* 02 */
  81. {"DRAMPadCal "}, /* 01 */
  82. {"SInitEn "}, /* 00 */
  83. {0 }, /* 31 */
  84. {0 }, /* 30 */
  85. {0 }, /* 29 */
  86. {0 }, /* 28 */
  87. {0 }, /* 27 */
  88. {0 }, /* 26 */
  89. {0 }, /* 25 */
  90. {0 }, /* 24 */
  91. {0 }, /* 23 */
  92. {0 }, /* 22 */
  93. {"JTAGCalBy "}, /* 21 */
  94. {"GB2Sel "}, /* 20 */
  95. {"GB1Sel "}, /* 19 */
  96. {"DRAMPLL_MDiv_5"}, /* 18 */
  97. {"DRAMPLL_MDiv_4"}, /* 17 */
  98. {"DRAMPLL_MDiv_3"}, /* 16 */
  99. {"DRAMPLL_MDiv_2"}, /* 15 */
  100. {"DRAMPLL_MDiv_1"}, /* 14 */
  101. {"DRAMPLL_MDiv_0"}, /* 13 */
  102. {"GB0Sel "}, /* 12 */
  103. {"DRAMPLLPU "}, /* 11 */
  104. {"DRAMPLL_HIKVCO"}, /* 10 */
  105. {"DRAMPLLNP "}, /* 09 */
  106. {"DRAMPLL_NDiv_7"}, /* 08 */
  107. {"DRAMPLL_NDiv_6"}, /* 07 */
  108. {"CPUPadCal "}, /* 06 */
  109. {"DRAMPLL_NDiv_5"}, /* 05 */
  110. {"DRAMPLL_NDiv_4"}, /* 04 */
  111. {"DRAMPLL_NDiv_3"}, /* 03 */
  112. {"DRAMPLL_NDiv_2"}, /* 02 */
  113. {"DRAMPLL_NDiv_1"}, /* 01 */
  114. {"DRAMPLL_NDiv_0"}}; /* 00 */
  115. extern flash_info_t flash_info[];
  116. extern int do_bootvx (cmd_tbl_t *, int, int, char *[]);
  117. /* ------------------------------------------------------------------------- */
  118. /* this is the current GT register space location */
  119. /* it starts at CONFIG_SYS_DFL_GT_REGS but moves later to CONFIG_SYS_GT_REGS */
  120. /* Unfortunately, we cant change it while we are in flash, so we initialize it
  121. * to the "final" value. This means that any debug_led calls before
  122. * board_early_init_f wont work right (like in cpu_init_f).
  123. * See also my_remap_gt_regs below. (NTL)
  124. */
  125. void board_prebootm_init (void);
  126. unsigned int INTERNAL_REG_BASE_ADDR = CONFIG_SYS_GT_REGS;
  127. int display_mem_map (void);
  128. /*
  129. * Skip video initialization on slave variant.
  130. * This function will overwrite the weak default in cfb_console.c
  131. */
  132. int board_video_skip(void)
  133. {
  134. return CPCI750_SLAVE_TEST;
  135. }
  136. /* ------------------------------------------------------------------------- */
  137. /*
  138. * This is a version of the GT register space remapping function that
  139. * doesn't touch globals (meaning, it's ok to run from flash.)
  140. *
  141. * Unfortunately, this has the side effect that a writable
  142. * INTERNAL_REG_BASE_ADDR is impossible. Oh well.
  143. */
  144. void my_remap_gt_regs (u32 cur_loc, u32 new_loc)
  145. {
  146. u32 temp;
  147. /* check and see if it's already moved */
  148. /* original ppcboot 1.1.6 source
  149. temp = in_le32((u32 *)(new_loc + INTERNAL_SPACE_DECODE));
  150. if ((temp & 0xffff) == new_loc >> 20)
  151. return;
  152. temp = (in_le32((u32 *)(cur_loc + INTERNAL_SPACE_DECODE)) &
  153. 0xffff0000) | (new_loc >> 20);
  154. out_le32((u32 *)(cur_loc + INTERNAL_SPACE_DECODE), temp);
  155. while (GTREGREAD(INTERNAL_SPACE_DECODE) != temp);
  156. original ppcboot 1.1.6 source end */
  157. temp = in_le32 ((u32 *) (new_loc + INTERNAL_SPACE_DECODE));
  158. if ((temp & 0xffff) == new_loc >> 16)
  159. return;
  160. temp = (in_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE)) &
  161. 0xffff0000) | (new_loc >> 16);
  162. out_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE), temp);
  163. while (GTREGREAD (INTERNAL_SPACE_DECODE) != temp);
  164. }
  165. #ifdef CONFIG_PCI
  166. static void gt_pci_config (void)
  167. {
  168. unsigned int stat;
  169. unsigned int data;
  170. unsigned int val = 0x00fff864; /* DINK32: BusNum 23:16, DevNum 15:11, FuncNum 10:8, RegNum 7:2 */
  171. /* In PCIX mode devices provide their own bus and device numbers. We query the Discovery II's
  172. * config registers by writing ones to the bus and device.
  173. * We then update the Virtual register with the correct value for the bus and device.
  174. */
  175. if ((GTREGREAD (PCI_0_MODE) & (BIT4 | BIT5)) != 0) { /*if PCI-X */
  176. GT_REG_WRITE (PCI_0_CONFIG_ADDR, BIT31 | val);
  177. GT_REG_READ (PCI_0_CONFIG_DATA_VIRTUAL_REG, &stat);
  178. GT_REG_WRITE (PCI_0_CONFIG_ADDR, BIT31 | val);
  179. GT_REG_WRITE (PCI_0_CONFIG_DATA_VIRTUAL_REG,
  180. (stat & 0xffff0000) | CONFIG_SYS_PCI_IDSEL);
  181. }
  182. if ((GTREGREAD (PCI_1_MODE) & (BIT4 | BIT5)) != 0) { /*if PCI-X */
  183. GT_REG_WRITE (PCI_1_CONFIG_ADDR, BIT31 | val);
  184. GT_REG_READ (PCI_1_CONFIG_DATA_VIRTUAL_REG, &stat);
  185. GT_REG_WRITE (PCI_1_CONFIG_ADDR, BIT31 | val);
  186. GT_REG_WRITE (PCI_1_CONFIG_DATA_VIRTUAL_REG,
  187. (stat & 0xffff0000) | CONFIG_SYS_PCI_IDSEL);
  188. }
  189. /* Enable master */
  190. PCI_MASTER_ENABLE (0, SELF);
  191. PCI_MASTER_ENABLE (1, SELF);
  192. /* Enable PCI0/1 Mem0 and IO 0 disable all others */
  193. GT_REG_READ (BASE_ADDR_ENABLE, &stat);
  194. stat |= (1 << 11) | (1 << 12) | (1 << 13) | (1 << 16) | (1 << 17) | (1
  195. <<
  196. 18);
  197. stat &= ~((1 << 9) | (1 << 10) | (1 << 14) | (1 << 15));
  198. GT_REG_WRITE (BASE_ADDR_ENABLE, stat);
  199. /* ronen- add write to pci remap registers for 64460.
  200. in 64360 when writing to pci base go and overide remap automaticaly,
  201. in 64460 it doesn't */
  202. GT_REG_WRITE (PCI_0_IO_BASE_ADDR, CONFIG_SYS_PCI0_IO_SPACE >> 16);
  203. GT_REG_WRITE (PCI_0I_O_ADDRESS_REMAP, CONFIG_SYS_PCI0_IO_SPACE_PCI >> 16);
  204. GT_REG_WRITE (PCI_0_IO_SIZE, (CONFIG_SYS_PCI0_IO_SIZE - 1) >> 16);
  205. GT_REG_WRITE (PCI_0_MEMORY0_BASE_ADDR, CONFIG_SYS_PCI0_MEM_BASE >> 16);
  206. GT_REG_WRITE (PCI_0MEMORY0_ADDRESS_REMAP, CONFIG_SYS_PCI0_MEM_BASE >> 16);
  207. GT_REG_WRITE (PCI_0_MEMORY0_SIZE, (CONFIG_SYS_PCI0_MEM_SIZE - 1) >> 16);
  208. GT_REG_WRITE (PCI_1_IO_BASE_ADDR, CONFIG_SYS_PCI1_IO_SPACE >> 16);
  209. GT_REG_WRITE (PCI_1I_O_ADDRESS_REMAP, CONFIG_SYS_PCI1_IO_SPACE_PCI >> 16);
  210. GT_REG_WRITE (PCI_1_IO_SIZE, (CONFIG_SYS_PCI1_IO_SIZE - 1) >> 16);
  211. GT_REG_WRITE (PCI_1_MEMORY0_BASE_ADDR, CONFIG_SYS_PCI1_MEM_BASE >> 16);
  212. GT_REG_WRITE (PCI_1MEMORY0_ADDRESS_REMAP, CONFIG_SYS_PCI1_MEM_BASE >> 16);
  213. GT_REG_WRITE (PCI_1_MEMORY0_SIZE, (CONFIG_SYS_PCI1_MEM_SIZE - 1) >> 16);
  214. /* PCI interface settings */
  215. /* Timeout set to retry forever */
  216. GT_REG_WRITE (PCI_0TIMEOUT_RETRY, 0x0);
  217. GT_REG_WRITE (PCI_1TIMEOUT_RETRY, 0x0);
  218. /* ronen - enable only CS0 and Internal reg!! */
  219. GT_REG_WRITE (PCI_0BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
  220. GT_REG_WRITE (PCI_1BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
  221. /*ronen update the pci internal registers base address.*/
  222. #ifdef MAP_PCI
  223. for (stat = 0; stat <= PCI_HOST1; stat++) {
  224. data = pciReadConfigReg(stat,
  225. PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
  226. SELF);
  227. data = (data & 0x0f) | CONFIG_SYS_GT_REGS;
  228. pciWriteConfigReg (stat,
  229. PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS,
  230. SELF, data);
  231. }
  232. #endif
  233. }
  234. #endif
  235. /* Setup CPU interface paramaters */
  236. static void gt_cpu_config (void)
  237. {
  238. cpu_t cpu = get_cpu_type ();
  239. ulong tmp;
  240. /* cpu configuration register */
  241. tmp = GTREGREAD (CPU_CONFIGURATION);
  242. /* set the SINGLE_CPU bit see MV64360 P.399 */
  243. #ifndef CONFIG_SYS_GT_DUAL_CPU /* SINGLE_CPU seems to cause JTAG problems */
  244. tmp |= CPU_CONF_SINGLE_CPU;
  245. #endif
  246. tmp &= ~CPU_CONF_AACK_DELAY_2;
  247. tmp |= CPU_CONF_DP_VALID;
  248. tmp |= CPU_CONF_AP_VALID;
  249. tmp |= CPU_CONF_PIPELINE;
  250. GT_REG_WRITE (CPU_CONFIGURATION, tmp); /* Marvell (VXWorks) writes 0x20220FF */
  251. /* CPU master control register */
  252. tmp = GTREGREAD (CPU_MASTER_CONTROL);
  253. tmp |= CPU_MAST_CTL_ARB_EN;
  254. if ((cpu == CPU_7400) ||
  255. (cpu == CPU_7410) || (cpu == CPU_7455) || (cpu == CPU_7450)) {
  256. tmp |= CPU_MAST_CTL_CLEAN_BLK;
  257. tmp |= CPU_MAST_CTL_FLUSH_BLK;
  258. } else {
  259. /* cleanblock must be cleared for CPUs
  260. * that do not support this command (603e, 750)
  261. * see Res#1 */
  262. tmp &= ~CPU_MAST_CTL_CLEAN_BLK;
  263. tmp &= ~CPU_MAST_CTL_FLUSH_BLK;
  264. }
  265. GT_REG_WRITE (CPU_MASTER_CONTROL, tmp);
  266. }
  267. /*
  268. * board_early_init_f.
  269. *
  270. * set up gal. device mappings, etc.
  271. */
  272. int board_early_init_f (void)
  273. {
  274. /*
  275. * set up the GT the way the kernel wants it
  276. * the call to move the GT register space will obviously
  277. * fail if it has already been done, but we're going to assume
  278. * that if it's not at the power-on location, it's where we put
  279. * it last time. (huber)
  280. */
  281. my_remap_gt_regs (CONFIG_SYS_DFL_GT_REGS, CONFIG_SYS_GT_REGS);
  282. /* No PCI in first release of Port To_do: enable it. */
  283. #ifdef CONFIG_PCI
  284. gt_pci_config ();
  285. #endif
  286. /* mask all external interrupt sources */
  287. GT_REG_WRITE (CPU_INTERRUPT_MASK_REGISTER_LOW, 0);
  288. GT_REG_WRITE (CPU_INTERRUPT_MASK_REGISTER_HIGH, 0);
  289. /* new in MV6436x */
  290. GT_REG_WRITE (CPU_INTERRUPT_1_MASK_REGISTER_LOW, 0);
  291. GT_REG_WRITE (CPU_INTERRUPT_1_MASK_REGISTER_HIGH, 0);
  292. /* --------------------- */
  293. GT_REG_WRITE (PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0);
  294. GT_REG_WRITE (PCI_0INTERRUPT_CAUSE_MASK_REGISTER_HIGH, 0);
  295. GT_REG_WRITE (PCI_1INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0);
  296. GT_REG_WRITE (PCI_1INTERRUPT_CAUSE_MASK_REGISTER_HIGH, 0);
  297. /* does not exist in MV6436x
  298. GT_REG_WRITE(CPU_INT_0_MASK, 0);
  299. GT_REG_WRITE(CPU_INT_1_MASK, 0);
  300. GT_REG_WRITE(CPU_INT_2_MASK, 0);
  301. GT_REG_WRITE(CPU_INT_3_MASK, 0);
  302. --------------------- */
  303. /* ----- DEVICE BUS SETTINGS ------ */
  304. /*
  305. * EVB
  306. * 0 - SRAM ????
  307. * 1 - RTC ????
  308. * 2 - UART ????
  309. * 3 - Flash checked 32Bit Intel Strata
  310. * boot - BootCS checked 8Bit 29LV040B
  311. *
  312. */
  313. /*
  314. * the dual 7450 module requires burst access to the boot
  315. * device, so the serial rom copies the boot device to the
  316. * on-board sram on the eval board, and updates the correct
  317. * registers to boot from the sram. (device0)
  318. */
  319. memoryMapDeviceSpace (DEVICE0, CONFIG_SYS_DEV0_SPACE, CONFIG_SYS_DEV0_SIZE);
  320. memoryMapDeviceSpace (DEVICE1, CONFIG_SYS_DEV1_SPACE, CONFIG_SYS_DEV1_SIZE);
  321. memoryMapDeviceSpace (DEVICE2, CONFIG_SYS_DEV2_SPACE, CONFIG_SYS_DEV2_SIZE);
  322. memoryMapDeviceSpace (DEVICE3, CONFIG_SYS_DEV3_SPACE, CONFIG_SYS_DEV3_SIZE);
  323. /* configure device timing */
  324. GT_REG_WRITE (DEVICE_BANK0PARAMETERS, CONFIG_SYS_DEV0_PAR);
  325. GT_REG_WRITE (DEVICE_BANK1PARAMETERS, CONFIG_SYS_DEV1_PAR);
  326. GT_REG_WRITE (DEVICE_BANK2PARAMETERS, CONFIG_SYS_DEV2_PAR);
  327. GT_REG_WRITE (DEVICE_BANK3PARAMETERS, CONFIG_SYS_DEV3_PAR);
  328. #ifdef CONFIG_SYS_32BIT_BOOT_PAR /* set port parameters for Flash device module access */
  329. /* detect if we are booting from the 32 bit flash */
  330. if (GTREGREAD (DEVICE_BOOT_BANK_PARAMETERS) & (0x3 << 20)) {
  331. /* 32 bit boot flash */
  332. GT_REG_WRITE (DEVICE_BANK3PARAMETERS, CONFIG_SYS_8BIT_BOOT_PAR);
  333. GT_REG_WRITE (DEVICE_BOOT_BANK_PARAMETERS,
  334. CONFIG_SYS_32BIT_BOOT_PAR);
  335. } else {
  336. /* 8 bit boot flash */
  337. GT_REG_WRITE (DEVICE_BANK3PARAMETERS, CONFIG_SYS_32BIT_BOOT_PAR);
  338. GT_REG_WRITE (DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_8BIT_BOOT_PAR);
  339. }
  340. #else
  341. /* 8 bit boot flash only */
  342. /* GT_REG_WRITE(DEVICE_BOOT_BANK_PARAMETERS, CONFIG_SYS_8BIT_BOOT_PAR);*/
  343. #endif
  344. gt_cpu_config ();
  345. /* MPP setup */
  346. GT_REG_WRITE (MPP_CONTROL0, CONFIG_SYS_MPP_CONTROL_0);
  347. GT_REG_WRITE (MPP_CONTROL1, CONFIG_SYS_MPP_CONTROL_1);
  348. GT_REG_WRITE (MPP_CONTROL2, CONFIG_SYS_MPP_CONTROL_2);
  349. GT_REG_WRITE (MPP_CONTROL3, CONFIG_SYS_MPP_CONTROL_3);
  350. GT_REG_WRITE (GPP_LEVEL_CONTROL, CONFIG_SYS_GPP_LEVEL_CONTROL);
  351. DEBUG_LED0_ON ();
  352. DEBUG_LED1_ON ();
  353. DEBUG_LED2_ON ();
  354. return 0;
  355. }
  356. /* various things to do after relocation */
  357. int misc_init_r ()
  358. {
  359. icache_enable ();
  360. #ifdef CONFIG_SYS_L2
  361. l2cache_enable ();
  362. #endif
  363. #ifdef CONFIG_MPSC
  364. mpsc_sdma_init ();
  365. mpsc_init2 ();
  366. #endif
  367. #if 0
  368. /* disable the dcache and MMU */
  369. dcache_lock ();
  370. #endif
  371. if (flash_info[3].size < CONFIG_SYS_FLASH_INCREMENT) {
  372. unsigned int flash_offset;
  373. unsigned int l;
  374. flash_offset = CONFIG_SYS_FLASH_INCREMENT - flash_info[3].size;
  375. for (l = 0; l < CONFIG_SYS_MAX_FLASH_SECT; l++) {
  376. if (flash_info[3].start[l] != 0) {
  377. flash_info[3].start[l] += flash_offset;
  378. }
  379. }
  380. flash_protect (FLAG_PROTECT_SET,
  381. CONFIG_SYS_MONITOR_BASE,
  382. CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
  383. &flash_info[3]);
  384. }
  385. return 0;
  386. }
  387. void after_reloc (ulong dest_addr, gd_t * gd)
  388. {
  389. memoryMapDeviceSpace (BOOT_DEVICE, CONFIG_SYS_BOOT_SPACE,
  390. CONFIG_SYS_BOOT_SIZE);
  391. display_mem_map ();
  392. GT_REG_WRITE (PCI_0BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
  393. GT_REG_WRITE (PCI_1BASE_ADDRESS_REGISTERS_ENABLE, 0xfffffdfe);
  394. /* now, jump to the main ppcboot board init code */
  395. board_init_r (gd, dest_addr);
  396. /* NOTREACHED */
  397. }
  398. /* ------------------------------------------------------------------------- */
  399. /*
  400. * Check Board Identity:
  401. *
  402. * right now, assume borad type. (there is just one...after all)
  403. */
  404. int checkboard (void)
  405. {
  406. int l_type = 0;
  407. printf ("BOARD: %s\n", CONFIG_SYS_BOARD_NAME);
  408. return (l_type);
  409. }
  410. /* utility functions */
  411. void debug_led (int led, int mode)
  412. {
  413. }
  414. int display_mem_map (void)
  415. {
  416. int i, j;
  417. unsigned int base, size, width;
  418. /* SDRAM */
  419. printf ("SD (DDR) RAM\n");
  420. for (i = 0; i <= BANK3; i++) {
  421. base = memoryGetBankBaseAddress (i);
  422. size = memoryGetBankSize (i);
  423. if (size != 0) {
  424. printf ("BANK%d: base - 0x%08x\tsize - %dM bytes\n",
  425. i, base, size >> 20);
  426. }
  427. }
  428. #ifdef CONFIG_PCI
  429. /* CPU's PCI windows */
  430. for (i = 0; i <= PCI_HOST1; i++) {
  431. printf ("\nCPU's PCI %d windows\n", i);
  432. base = pciGetSpaceBase (i, PCI_IO);
  433. size = pciGetSpaceSize (i, PCI_IO);
  434. printf (" IO: base - 0x%08x\tsize - %dM bytes\n", base,
  435. size >> 20);
  436. for (j = 0;
  437. j <=
  438. PCI_REGION0
  439. /*ronen currently only first PCI MEM is used 3 */ ;
  440. j++) {
  441. base = pciGetSpaceBase (i, j);
  442. size = pciGetSpaceSize (i, j);
  443. printf ("MEMORY %d: base - 0x%08x\tsize - %dM bytes\n", j, base, size >> 20);
  444. }
  445. }
  446. #endif /* of CONFIG_PCI */
  447. /* Devices */
  448. printf ("\nDEVICES\n");
  449. for (i = 0; i <= DEVICE3; i++) {
  450. base = memoryGetDeviceBaseAddress (i);
  451. size = memoryGetDeviceSize (i);
  452. width = memoryGetDeviceWidth (i) * 8;
  453. printf ("DEV %d: base - 0x%08x size - %dM bytes\twidth - %d bits", i, base, size >> 20, width);
  454. if (i == 0)
  455. printf ("\t- FLASH\n");
  456. else if (i == 1)
  457. printf ("\t- FLASH\n");
  458. else if (i == 2)
  459. printf ("\t- FLASH\n");
  460. else
  461. printf ("\t- RTC/REGS/CAN\n");
  462. }
  463. /* Bootrom */
  464. base = memoryGetDeviceBaseAddress (BOOT_DEVICE); /* Boot */
  465. size = memoryGetDeviceSize (BOOT_DEVICE);
  466. width = memoryGetDeviceWidth (BOOT_DEVICE) * 8;
  467. printf (" BOOT: base - 0x%08x size - %dM bytes\twidth - %d bits\t- FLASH\n",
  468. base, size >> 20, width);
  469. return (0);
  470. }
  471. /*
  472. * Command loadpci: wait for signal from host and boot image.
  473. */
  474. int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  475. {
  476. volatile unsigned int *ptr;
  477. int count = 0;
  478. int count2 = 0;
  479. int status = 0;
  480. char addr[16];
  481. char str[] = "\\|/-";
  482. char *local_args[2];
  483. /*
  484. * Mark sync address
  485. */
  486. ptr = 0;
  487. ptr[0] = 0xffffffff;
  488. ptr[1] = 0xffffffff;
  489. puts("\nWaiting for image from pci host -");
  490. /*
  491. * Wait for host to write the start address
  492. */
  493. while (*ptr == 0xffffffff) {
  494. count++;
  495. if (!(count % 100)) {
  496. count2++;
  497. putc(0x08); /* backspace */
  498. putc(str[count2 % 4]);
  499. }
  500. /* Abort if ctrl-c was pressed */
  501. if (ctrlc()) {
  502. puts("\nAbort\n");
  503. return 0;
  504. }
  505. udelay(1000);
  506. }
  507. sprintf(addr, "%08x", *ptr);
  508. printf("\nBooting Image at addr 0x%s ...\n", addr);
  509. setenv("loadaddr", addr);
  510. switch (ptr[1] == 0) {
  511. case 0:
  512. /*
  513. * Boot image via bootm
  514. */
  515. local_args[0] = argv[0];
  516. local_args[1] = NULL;
  517. status = do_bootm (cmdtp, 0, 1, local_args);
  518. break;
  519. case 1:
  520. /*
  521. * Boot image via bootvx
  522. */
  523. local_args[0] = argv[0];
  524. local_args[1] = NULL;
  525. status = do_bootvx (cmdtp, 0, 1, local_args);
  526. break;
  527. }
  528. return status;
  529. }
  530. U_BOOT_CMD(
  531. loadpci, 1, 1, do_loadpci,
  532. "loadpci - Wait for pci-image and boot it\n",
  533. NULL
  534. );
  535. /* DRAM check routines copied from gw8260 */
  536. #if defined (CONFIG_SYS_DRAM_TEST)
  537. /*********************************************************************/
  538. /* NAME: move64() - moves a double word (64-bit) */
  539. /* */
  540. /* DESCRIPTION: */
  541. /* this function performs a double word move from the data at */
  542. /* the source pointer to the location at the destination pointer. */
  543. /* */
  544. /* INPUTS: */
  545. /* unsigned long long *src - pointer to data to move */
  546. /* */
  547. /* OUTPUTS: */
  548. /* unsigned long long *dest - pointer to locate to move data */
  549. /* */
  550. /* RETURNS: */
  551. /* None */
  552. /* */
  553. /* RESTRICTIONS/LIMITATIONS: */
  554. /* May cloober fr0. */
  555. /* */
  556. /*********************************************************************/
  557. static void move64 (unsigned long long *src, unsigned long long *dest)
  558. {
  559. asm ("lfd 0, 0(3)\n\t" /* fpr0 = *scr */
  560. "stfd 0, 0(4)" /* *dest = fpr0 */
  561. : : : "fr0"); /* Clobbers fr0 */
  562. return;
  563. }
  564. #if defined (CONFIG_SYS_DRAM_TEST_DATA)
  565. unsigned long long pattern[] = {
  566. 0xaaaaaaaaaaaaaaaaLL,
  567. 0xccccccccccccccccLL,
  568. 0xf0f0f0f0f0f0f0f0LL,
  569. 0xff00ff00ff00ff00LL,
  570. 0xffff0000ffff0000LL,
  571. 0xffffffff00000000LL,
  572. 0x00000000ffffffffLL,
  573. 0x0000ffff0000ffffLL,
  574. 0x00ff00ff00ff00ffLL,
  575. 0x0f0f0f0f0f0f0f0fLL,
  576. 0x3333333333333333LL,
  577. 0x5555555555555555LL,
  578. };
  579. /*********************************************************************/
  580. /* NAME: mem_test_data() - test data lines for shorts and opens */
  581. /* */
  582. /* DESCRIPTION: */
  583. /* Tests data lines for shorts and opens by forcing adjacent data */
  584. /* to opposite states. Because the data lines could be routed in */
  585. /* an arbitrary manner the must ensure test patterns ensure that */
  586. /* every case is tested. By using the following series of binary */
  587. /* patterns every combination of adjacent bits is test regardless */
  588. /* of routing. */
  589. /* */
  590. /* ...101010101010101010101010 */
  591. /* ...110011001100110011001100 */
  592. /* ...111100001111000011110000 */
  593. /* ...111111110000000011111111 */
  594. /* */
  595. /* Carrying this out, gives us six hex patterns as follows: */
  596. /* */
  597. /* 0xaaaaaaaaaaaaaaaa */
  598. /* 0xcccccccccccccccc */
  599. /* 0xf0f0f0f0f0f0f0f0 */
  600. /* 0xff00ff00ff00ff00 */
  601. /* 0xffff0000ffff0000 */
  602. /* 0xffffffff00000000 */
  603. /* */
  604. /* The number test patterns will always be given by: */
  605. /* */
  606. /* log(base 2)(number data bits) = log2 (64) = 6 */
  607. /* */
  608. /* To test for short and opens to other signals on our boards. we */
  609. /* simply */
  610. /* test with the 1's complemnt of the paterns as well. */
  611. /* */
  612. /* OUTPUTS: */
  613. /* Displays failing test pattern */
  614. /* */
  615. /* RETURNS: */
  616. /* 0 - Passed test */
  617. /* 1 - Failed test */
  618. /* */
  619. /* RESTRICTIONS/LIMITATIONS: */
  620. /* Assumes only one one SDRAM bank */
  621. /* */
  622. /*********************************************************************/
  623. int mem_test_data (void)
  624. {
  625. unsigned long long *pmem = (unsigned long long *) CONFIG_SYS_MEMTEST_START;
  626. unsigned long long temp64 = 0;
  627. int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
  628. int i;
  629. unsigned int hi, lo;
  630. for (i = 0; i < num_patterns; i++) {
  631. move64 (&(pattern[i]), pmem);
  632. move64 (pmem, &temp64);
  633. /* hi = (temp64>>32) & 0xffffffff; */
  634. /* lo = temp64 & 0xffffffff; */
  635. /* printf("\ntemp64 = 0x%08x%08x", hi, lo); */
  636. hi = (pattern[i] >> 32) & 0xffffffff;
  637. lo = pattern[i] & 0xffffffff;
  638. /* printf("\npattern[%d] = 0x%08x%08x", i, hi, lo); */
  639. if (temp64 != pattern[i]) {
  640. printf ("\n Data Test Failed, pattern 0x%08x%08x",
  641. hi, lo);
  642. return 1;
  643. }
  644. }
  645. return 0;
  646. }
  647. #endif /* CONFIG_SYS_DRAM_TEST_DATA */
  648. #if defined (CONFIG_SYS_DRAM_TEST_ADDRESS)
  649. /*********************************************************************/
  650. /* NAME: mem_test_address() - test address lines */
  651. /* */
  652. /* DESCRIPTION: */
  653. /* This function performs a test to verify that each word im */
  654. /* memory is uniquly addressable. The test sequence is as follows: */
  655. /* */
  656. /* 1) write the address of each word to each word. */
  657. /* 2) verify that each location equals its address */
  658. /* */
  659. /* OUTPUTS: */
  660. /* Displays failing test pattern and address */
  661. /* */
  662. /* RETURNS: */
  663. /* 0 - Passed test */
  664. /* 1 - Failed test */
  665. /* */
  666. /* RESTRICTIONS/LIMITATIONS: */
  667. /* */
  668. /* */
  669. /*********************************************************************/
  670. int mem_test_address (void)
  671. {
  672. volatile unsigned int *pmem =
  673. (volatile unsigned int *) CONFIG_SYS_MEMTEST_START;
  674. const unsigned int size = (CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START) / 4;
  675. unsigned int i;
  676. /* write address to each location */
  677. for (i = 0; i < size; i++) {
  678. pmem[i] = i;
  679. }
  680. /* verify each loaction */
  681. for (i = 0; i < size; i++) {
  682. if (pmem[i] != i) {
  683. printf ("\n Address Test Failed at 0x%x", i);
  684. return 1;
  685. }
  686. }
  687. return 0;
  688. }
  689. #endif /* CONFIG_SYS_DRAM_TEST_ADDRESS */
  690. #if defined (CONFIG_SYS_DRAM_TEST_WALK)
  691. /*********************************************************************/
  692. /* NAME: mem_march() - memory march */
  693. /* */
  694. /* DESCRIPTION: */
  695. /* Marches up through memory. At each location verifies rmask if */
  696. /* read = 1. At each location write wmask if write = 1. Displays */
  697. /* failing address and pattern. */
  698. /* */
  699. /* INPUTS: */
  700. /* volatile unsigned long long * base - start address of test */
  701. /* unsigned int size - number of dwords(64-bit) to test */
  702. /* unsigned long long rmask - read verify mask */
  703. /* unsigned long long wmask - wrtie verify mask */
  704. /* short read - verifies rmask if read = 1 */
  705. /* short write - writes wmask if write = 1 */
  706. /* */
  707. /* OUTPUTS: */
  708. /* Displays failing test pattern and address */
  709. /* */
  710. /* RETURNS: */
  711. /* 0 - Passed test */
  712. /* 1 - Failed test */
  713. /* */
  714. /* RESTRICTIONS/LIMITATIONS: */
  715. /* */
  716. /* */
  717. /*********************************************************************/
  718. int mem_march (volatile unsigned long long *base,
  719. unsigned int size,
  720. unsigned long long rmask,
  721. unsigned long long wmask, short read, short write)
  722. {
  723. unsigned int i;
  724. unsigned long long temp = 0;
  725. unsigned int hitemp, lotemp, himask, lomask;
  726. for (i = 0; i < size; i++) {
  727. if (read != 0) {
  728. /* temp = base[i]; */
  729. move64 ((unsigned long long *) &(base[i]), &temp);
  730. if (rmask != temp) {
  731. hitemp = (temp >> 32) & 0xffffffff;
  732. lotemp = temp & 0xffffffff;
  733. himask = (rmask >> 32) & 0xffffffff;
  734. lomask = rmask & 0xffffffff;
  735. printf ("\n Walking one's test failed: address = 0x%08x," "\n\texpected 0x%08x%08x, found 0x%08x%08x", i << 3, himask, lomask, hitemp, lotemp);
  736. return 1;
  737. }
  738. }
  739. if (write != 0) {
  740. /* base[i] = wmask; */
  741. move64 (&wmask, (unsigned long long *) &(base[i]));
  742. }
  743. }
  744. return 0;
  745. }
  746. #endif /* CONFIG_SYS_DRAM_TEST_WALK */
  747. /*********************************************************************/
  748. /* NAME: mem_test_walk() - a simple walking ones test */
  749. /* */
  750. /* DESCRIPTION: */
  751. /* Performs a walking ones through entire physical memory. The */
  752. /* test uses as series of memory marches, mem_march(), to verify */
  753. /* and write the test patterns to memory. The test sequence is as */
  754. /* follows: */
  755. /* 1) march writing 0000...0001 */
  756. /* 2) march verifying 0000...0001 , writing 0000...0010 */
  757. /* 3) repeat step 2 shifting masks left 1 bit each time unitl */
  758. /* the write mask equals 1000...0000 */
  759. /* 4) march verifying 1000...0000 */
  760. /* The test fails if any of the memory marches return a failure. */
  761. /* */
  762. /* OUTPUTS: */
  763. /* Displays which pass on the memory test is executing */
  764. /* */
  765. /* RETURNS: */
  766. /* 0 - Passed test */
  767. /* 1 - Failed test */
  768. /* */
  769. /* RESTRICTIONS/LIMITATIONS: */
  770. /* */
  771. /* */
  772. /*********************************************************************/
  773. int mem_test_walk (void)
  774. {
  775. unsigned long long mask;
  776. volatile unsigned long long *pmem =
  777. (volatile unsigned long long *) CONFIG_SYS_MEMTEST_START;
  778. const unsigned long size = (CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START) / 8;
  779. unsigned int i;
  780. mask = 0x01;
  781. printf ("Initial Pass");
  782. mem_march (pmem, size, 0x0, 0x1, 0, 1);
  783. printf ("\b\b\b\b\b\b\b\b\b\b\b\b");
  784. printf (" ");
  785. printf (" ");
  786. printf ("\b\b\b\b\b\b\b\b\b\b\b\b");
  787. for (i = 0; i < 63; i++) {
  788. printf ("Pass %2d", i + 2);
  789. if (mem_march (pmem, size, mask, mask << 1, 1, 1) != 0) {
  790. /*printf("mask: 0x%x, pass: %d, ", mask, i); */
  791. return 1;
  792. }
  793. mask = mask << 1;
  794. printf ("\b\b\b\b\b\b\b");
  795. }
  796. printf ("Last Pass");
  797. if (mem_march (pmem, size, 0, mask, 0, 1) != 0) {
  798. /* printf("mask: 0x%x", mask); */
  799. return 1;
  800. }
  801. printf ("\b\b\b\b\b\b\b\b\b");
  802. printf (" ");
  803. printf ("\b\b\b\b\b\b\b\b\b");
  804. return 0;
  805. }
  806. /*********************************************************************/
  807. /* NAME: testdram() - calls any enabled memory tests */
  808. /* */
  809. /* DESCRIPTION: */
  810. /* Runs memory tests if the environment test variables are set to */
  811. /* 'y'. */
  812. /* */
  813. /* INPUTS: */
  814. /* testdramdata - If set to 'y', data test is run. */
  815. /* testdramaddress - If set to 'y', address test is run. */
  816. /* testdramwalk - If set to 'y', walking ones test is run */
  817. /* */
  818. /* OUTPUTS: */
  819. /* None */
  820. /* */
  821. /* RETURNS: */
  822. /* 0 - Passed test */
  823. /* 1 - Failed test */
  824. /* */
  825. /* RESTRICTIONS/LIMITATIONS: */
  826. /* */
  827. /* */
  828. /*********************************************************************/
  829. int testdram (void)
  830. {
  831. int rundata = 0;
  832. int runaddress = 0;
  833. int runwalk = 0;
  834. #ifdef CONFIG_SYS_DRAM_TEST_DATA
  835. rundata = getenv_yesno("testdramdata") == 1;
  836. #endif
  837. #ifdef CONFIG_SYS_DRAM_TEST_ADDRESS
  838. runaddress = getenv_yesno("testdramaddress") == 1;
  839. #endif
  840. #ifdef CONFIG_SYS_DRAM_TEST_WALK
  841. runwalk = getenv_yesno("testdramwalk") == 1;
  842. #endif
  843. if ((rundata == 1) || (runaddress == 1) || (runwalk == 1)) {
  844. printf ("Testing RAM from 0x%08x to 0x%08x ... (don't panic... that will take a moment !!!!)\n", CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END);
  845. }
  846. #ifdef CONFIG_SYS_DRAM_TEST_DATA
  847. if (rundata == 1) {
  848. printf ("Test DATA ... ");
  849. if (mem_test_data () == 1) {
  850. printf ("failed \n");
  851. return 1;
  852. } else
  853. printf ("ok \n");
  854. }
  855. #endif
  856. #ifdef CONFIG_SYS_DRAM_TEST_ADDRESS
  857. if (runaddress == 1) {
  858. printf ("Test ADDRESS ... ");
  859. if (mem_test_address () == 1) {
  860. printf ("failed \n");
  861. return 1;
  862. } else
  863. printf ("ok \n");
  864. }
  865. #endif
  866. #ifdef CONFIG_SYS_DRAM_TEST_WALK
  867. if (runwalk == 1) {
  868. printf ("Test WALKING ONEs ... ");
  869. if (mem_test_walk () == 1) {
  870. printf ("failed \n");
  871. return 1;
  872. } else
  873. printf ("ok \n");
  874. }
  875. #endif
  876. if ((rundata == 1) || (runaddress == 1) || (runwalk == 1)) {
  877. printf ("passed\n");
  878. }
  879. return 0;
  880. }
  881. #endif /* CONFIG_SYS_DRAM_TEST */
  882. /* ronen - the below functions are used by the bootm function */
  883. /* - we map the base register to fbe00000 (same mapping as in the LSP) */
  884. /* - we turn off the RX gig dmas - to prevent the dma from overunning */
  885. /* the kernel data areas. */
  886. /* - we diable and invalidate the icache and dcache. */
  887. void my_remap_gt_regs_bootm (u32 cur_loc, u32 new_loc)
  888. {
  889. u32 temp;
  890. temp = in_le32 ((u32 *) (new_loc + INTERNAL_SPACE_DECODE));
  891. if ((temp & 0xffff) == new_loc >> 16)
  892. return;
  893. temp = (in_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE)) &
  894. 0xffff0000) | (new_loc >> 16);
  895. out_le32 ((u32 *) (cur_loc + INTERNAL_SPACE_DECODE), temp);
  896. while ((WORD_SWAP (*((volatile unsigned int *) (NONE_CACHEABLE |
  897. new_loc |
  898. (INTERNAL_SPACE_DECODE)))))
  899. != temp);
  900. }
  901. void board_prebootm_init ()
  902. {
  903. /* change window size of PCI1 IO in order tp prevent overlaping with REG BASE. */
  904. GT_REG_WRITE (PCI_1_IO_SIZE, (_64K - 1) >> 16);
  905. /* Stop GigE Rx DMA engines */
  906. GT_REG_WRITE (MV64360_ETH_RECEIVE_QUEUE_COMMAND_REG (0), 0x0000ff00);
  907. /* GT_REG_WRITE (MV64360_ETH_RECEIVE_QUEUE_COMMAND_REG (1), 0x0000ff00); */
  908. /* GV_REG_WRITE (MV64360_ETH_RECEIVE_QUEUE_COMMAND_REG (2), 0x0000ff00); */
  909. /* Relocate MV64360 internal regs */
  910. my_remap_gt_regs_bootm (CONFIG_SYS_GT_REGS, CONFIG_SYS_DFL_GT_REGS);
  911. icache_disable ();
  912. dcache_disable ();
  913. }
  914. int do_show_config(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
  915. {
  916. unsigned int reset_sample_low;
  917. unsigned int reset_sample_high;
  918. unsigned int l, l1, l2;
  919. GT_REG_READ(0x3c4, &reset_sample_low);
  920. GT_REG_READ(0x3d4, &reset_sample_high);
  921. printf("Reset configuration 0x%08x 0x%08x\n", reset_sample_low, reset_sample_high);
  922. l2 = 0;
  923. for (l=0; l<63; l++) {
  924. if (show_config_tab[l][0] != 0) {
  925. printf("%14s:%1x ", show_config_tab[l],
  926. ((reset_sample_low >> (31 - (l & 0x1f)))) & 0x01);
  927. l2++;
  928. if ((l2 % 4) == 0)
  929. printf("\n");
  930. } else {
  931. l1++;
  932. }
  933. if (l == 32)
  934. reset_sample_low = reset_sample_high;
  935. }
  936. printf("\n");
  937. return(0);
  938. }
  939. U_BOOT_CMD(
  940. show_config, 1, 1, do_show_config,
  941. "Show Marvell strapping register",
  942. "Show Marvell strapping register (ResetSampleLow ResetSampleHigh)"
  943. );
  944. int do_pldver(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  945. {
  946. printf("PLD version:0x%02x\n", in_8((void *)CONFIG_SYS_PLD_VER));
  947. return 0;
  948. }
  949. U_BOOT_CMD(
  950. pldver, 1, 1, do_pldver,
  951. "Show PLD version",
  952. "Show PLD version)");
  953. int board_eth_init(bd_t *bis)
  954. {
  955. return mv6436x_eth_initialize(bis);
  956. }