umc-ld11.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. /*
  2. * Copyright (C) 2016 Socionext Inc.
  3. */
  4. #include <common.h>
  5. #include <linux/io.h>
  6. #include <linux/sizes.h>
  7. #include <asm/processor.h>
  8. #include "../init.h"
  9. #include "ddrphy-regs.h"
  10. #include "umc64-regs.h"
  11. #define DDR_FREQ 1600
  12. #define DRAM_CH_NR 2
  13. #define RANK_BLOCKS_TR 2
  14. enum dram_freq {
  15. DRAM_FREQ_1600M,
  16. DRAM_FREQ_NR,
  17. };
  18. enum dram_size {
  19. DRAM_SZ_256M,
  20. DRAM_SZ_512M,
  21. DRAM_SZ_NR,
  22. };
  23. /* PHY */
  24. const int rof_pos_shift_pre[RANK_BLOCKS_TR][2] = { {0, 0}, {0, 0} };
  25. const int rof_neg_shift_pre[RANK_BLOCKS_TR][2] = { {0, 0}, {0, 0} };
  26. const int rof_pos_shift[RANK_BLOCKS_TR][2] = { {-35, -35}, {-35, -35} };
  27. const int rof_neg_shift[RANK_BLOCKS_TR][2] = { {-17, -17}, {-17, -17} };
  28. const int tof_shift[RANK_BLOCKS_TR][2] = { {-50, -50}, {-50, -50} };
  29. /* Register address */
  30. #define PHY_ZQ0CR1 0x00000184
  31. #define PHY_ZQ1CR1 0x00000194
  32. #define PHY_ZQ2CR1 0x000001A4
  33. #define PHY_DX0GCR 0x000001C0
  34. #define PHY_DX0GTR 0x000001F0
  35. #define PHY_DX1GCR 0x00000200
  36. #define PHY_DX1GTR 0x00000230
  37. #define PHY_DX2GCR 0x00000240
  38. #define PHY_DX2GTR 0x00000270
  39. #define PHY_DX3GCR 0x00000280
  40. #define PHY_DX3GTR 0x000002B0
  41. #define PHY_DXMDLR(dx) (0x000001EC + 0x40 * (dx))
  42. #define PHY_DXLCDLR0(dx) (0x000001E0 + 0x40 * (dx))
  43. #define PHY_DXLCDLR1(dx) (0x000001E4 + 0x40 * (dx))
  44. #define PHY_DXLCDLR2(dx) (0x000001E8 + 0x40 * (dx))
  45. #define PHY_DXBDLR1(dx) (0x000001D0 + 0x40 * (dx))
  46. #define PHY_DXBDLR2(dx) (0x000001D4 + 0x40 * (dx))
  47. /* MASK */
  48. #define PHY_ACBD_MASK 0x00FC0000
  49. #define PHY_CK0BD_MASK 0x0000003F
  50. #define PHY_CK1BD_MASK 0x00000FC0
  51. #define PHY_IPRD_MASK 0x000000FF
  52. #define PHY_WLD_MASK(rank) (0xFF << (8 * (rank)))
  53. #define PHY_DQSGD_MASK(rank) (0xFF << (8 * (rank)))
  54. #define PHY_DQSGX_MASK BIT(6)
  55. #define PHY_DSWBD_MASK 0x3F000000 /* bit[29:24] */
  56. #define PHY_DSDQOE_MASK 0x00000FFF
  57. static void ddrphy_maskwritel(u32 data, u32 mask, void *addr)
  58. {
  59. u32 value;
  60. value = (readl(addr) & ~(mask)) | (data & mask);
  61. writel(value, addr);
  62. }
  63. static u32 ddrphy_maskreadl(u32 mask, void *addr)
  64. {
  65. return readl(addr) & mask;
  66. }
  67. /* step of 0.5T for PUB-byte */
  68. static u8 ddrphy_get_mdl(int dx, void __iomem *phy_base)
  69. {
  70. return ddrphy_maskreadl(PHY_IPRD_MASK, phy_base + PHY_DXMDLR(dx));
  71. }
  72. /* Calculating step for PUB-byte */
  73. static int ddrphy_hpstep(int delay, int dx, void __iomem *phy_base)
  74. {
  75. return delay * ddrphy_get_mdl(dx, phy_base) * DDR_FREQ / 1000000;
  76. }
  77. static void ddrphy_vt_ctrl(void __iomem *phy_base, int enable)
  78. {
  79. u32 tmp;
  80. tmp = readl(phy_base + PHY_PGCR1);
  81. if (enable)
  82. tmp &= ~PHY_PGCR1_INHVT;
  83. else
  84. tmp |= PHY_PGCR1_INHVT;
  85. writel(tmp, phy_base + PHY_PGCR1);
  86. if (!enable) {
  87. while (!(readl(phy_base + PHY_PGSR1) & PHY_PGSR1_VTSTOP))
  88. cpu_relax();
  89. }
  90. }
  91. static void ddrphy_set_ckoffset_qoffset(int delay_ckoffset0, int delay_ckoffset1,
  92. int delay_qoffset, int enable,
  93. void __iomem *phy_base)
  94. {
  95. u8 ck_step0, ck_step1; /* ckoffset_step for clock */
  96. u8 q_step; /* qoffset_step for clock */
  97. int dx;
  98. dx = 2; /* use dx2 in sLD11 */
  99. ck_step0 = ddrphy_hpstep(delay_ckoffset0, dx, phy_base); /* CK-Offset */
  100. ck_step1 = ddrphy_hpstep(delay_ckoffset1, dx, phy_base); /* CK-Offset */
  101. q_step = ddrphy_hpstep(delay_qoffset, dx, phy_base); /* Q-Offset */
  102. ddrphy_vt_ctrl(phy_base, 0);
  103. /* Q->[23:18], CK1->[11:6], CK0->bit[5:0] */
  104. if (enable == 1)
  105. ddrphy_maskwritel((q_step << 18) + (ck_step1 << 6) + ck_step0,
  106. PHY_ACBD_MASK | PHY_CK1BD_MASK | PHY_CK0BD_MASK,
  107. phy_base + PHY_ACBDLR);
  108. ddrphy_vt_ctrl(phy_base, 1);
  109. }
  110. static void ddrphy_set_wl_delay_dx(int dx, int r0_delay, int r1_delay,
  111. int enable, void __iomem *phy_base)
  112. {
  113. int rank;
  114. int delay_wl[4];
  115. u32 wl_mask = 0; /* WriteLeveling's Mask */
  116. u32 wl_value = 0; /* WriteLeveling's Value */
  117. delay_wl[0] = r0_delay & 0xfff;
  118. delay_wl[1] = r1_delay & 0xfff;
  119. delay_wl[2] = 0;
  120. delay_wl[3] = 0;
  121. ddrphy_vt_ctrl(phy_base, 0);
  122. for (rank = 0; rank < 4; rank++) {
  123. wl_mask |= PHY_WLD_MASK(rank);
  124. /* WriteLeveling's delay */
  125. wl_value |= ddrphy_hpstep(delay_wl[rank], dx, phy_base) << (8 * rank);
  126. }
  127. if (enable == 1)
  128. ddrphy_maskwritel(wl_value, wl_mask, phy_base + PHY_DXLCDLR0(dx));
  129. ddrphy_vt_ctrl(phy_base, 1);
  130. }
  131. static void ddrphy_set_dqsg_delay_dx(int dx, int r0_delay, int r1_delay,
  132. int enable, void __iomem *phy_base)
  133. {
  134. int rank;
  135. int delay_dqsg[4];
  136. u32 dqsg_mask = 0; /* DQSGating_LCDL_delay's Mask */
  137. u32 dqsg_value = 0; /* DQSGating_LCDL_delay's Value */
  138. delay_dqsg[0] = r0_delay;
  139. delay_dqsg[1] = r1_delay;
  140. delay_dqsg[2] = 0;
  141. delay_dqsg[3] = 0;
  142. ddrphy_vt_ctrl(phy_base, 0);
  143. for (rank = 0; rank < 4; rank++) {
  144. dqsg_mask |= PHY_DQSGD_MASK(rank);
  145. /* DQSGating's delay */
  146. dqsg_value |= ddrphy_hpstep(delay_dqsg[rank], dx, phy_base) << (8 * rank);
  147. }
  148. if (enable == 1)
  149. ddrphy_maskwritel(dqsg_value, dqsg_mask, phy_base + PHY_DXLCDLR2(dx));
  150. ddrphy_vt_ctrl(phy_base, 1);
  151. }
  152. static void ddrphy_set_dswb_delay_dx(int dx, int delay, int enable, void __iomem *phy_base)
  153. {
  154. u8 dswb_step;
  155. ddrphy_vt_ctrl(phy_base, 0);
  156. dswb_step = ddrphy_hpstep(delay, dx, phy_base); /* DQS-BDL's delay */
  157. if (enable == 1)
  158. ddrphy_maskwritel(dswb_step << 24, PHY_DSWBD_MASK, phy_base + PHY_DXBDLR1(dx));
  159. ddrphy_vt_ctrl(phy_base, 1);
  160. }
  161. static void ddrphy_set_oe_delay_dx(int dx, int dqs_delay, int dq_delay,
  162. int enable, void __iomem *phy_base)
  163. {
  164. u8 dqs_oe_step, dq_oe_step;
  165. u32 wdata;
  166. ddrphy_vt_ctrl(phy_base, 0);
  167. /* OE(DQS,DQ) */
  168. dqs_oe_step = ddrphy_hpstep(dqs_delay, dx, phy_base); /* DQS-oe's delay */
  169. dq_oe_step = ddrphy_hpstep(dq_delay, dx, phy_base); /* DQ-oe's delay */
  170. wdata = ((dq_oe_step<<6) + dqs_oe_step) & 0xFFF;
  171. if (enable == 1)
  172. ddrphy_maskwritel(wdata, PHY_DSDQOE_MASK, phy_base + PHY_DXBDLR2(dx));
  173. ddrphy_vt_ctrl(phy_base, 1);
  174. }
  175. static void ddrphy_ext_dqsgt(void __iomem *phy_base)
  176. {
  177. /* Extend DQSGating_window min:+1T max:+1T */
  178. ddrphy_maskwritel(PHY_DQSGX_MASK, PHY_DQSGX_MASK, phy_base + PHY_DSGCR);
  179. }
  180. static void ddrphy_shift_tof_hws(void __iomem *phy_base, const int shift[][2])
  181. {
  182. int dx, block, byte;
  183. u32 lcdlr1, wdqd;
  184. ddrphy_vt_ctrl(phy_base, 0);
  185. for (block = 0; block < RANK_BLOCKS_TR; block++) {
  186. for (byte = 0; byte < 2; byte++) {
  187. dx = block * 2 + byte;
  188. lcdlr1 = readl(phy_base + PHY_DXLCDLR1(dx));
  189. wdqd = lcdlr1 & 0xff;
  190. wdqd = clamp(wdqd + ddrphy_hpstep(shift[block][byte], dx, phy_base),
  191. 0U, 0xffU);
  192. lcdlr1 = (lcdlr1 & ~0xff) | wdqd;
  193. writel(lcdlr1, phy_base + PHY_DXLCDLR1(dx));
  194. readl(phy_base + PHY_DXLCDLR1(dx)); /* relax */
  195. }
  196. }
  197. ddrphy_vt_ctrl(phy_base, 1);
  198. }
  199. static void ddrphy_shift_rof_hws(void __iomem *phy_base, const int pos_shift[][2],
  200. const int neg_shift[][2])
  201. {
  202. int dx, block, byte;
  203. u32 lcdlr1, rdqsd, rdqnsd;
  204. ddrphy_vt_ctrl(phy_base, 0);
  205. for (block = 0; block < RANK_BLOCKS_TR; block++) {
  206. for (byte = 0; byte < 2; byte++) {
  207. dx = block * 2 + byte;
  208. lcdlr1 = readl(phy_base + PHY_DXLCDLR1(dx));
  209. /* DQS LCDL RDQNSD->[23:16] RDQSD->[15:8] */
  210. rdqsd = (lcdlr1 >> 8) & 0xff;
  211. rdqnsd = (lcdlr1 >> 16) & 0xff;
  212. rdqsd = clamp(rdqsd + ddrphy_hpstep(pos_shift[block][byte], dx, phy_base),
  213. 0U, 0xffU);
  214. rdqnsd = clamp(rdqnsd + ddrphy_hpstep(neg_shift[block][byte], dx, phy_base),
  215. 0U, 0xffU);
  216. lcdlr1 = (lcdlr1 & ~(0xffff << 8)) | (rdqsd << 8) | (rdqnsd << 16);
  217. readl(phy_base + PHY_DXLCDLR1(dx)); /* relax */
  218. }
  219. }
  220. ddrphy_vt_ctrl(phy_base, 1);
  221. }
  222. static void ddrphy_boot_run_hws(void __iomem *phy_base)
  223. {
  224. /* Hard Training for DIO */
  225. writel(0x0000f401, phy_base + PHY_PIR);
  226. while (!(readl(phy_base + PHY_PGSR0) & PHY_PGSR0_IDONE))
  227. cpu_relax();
  228. }
  229. static void ddrphy_training(void __iomem *phy_base)
  230. {
  231. /* DIO roffset shift before hard training */
  232. ddrphy_shift_rof_hws(phy_base, rof_pos_shift_pre, rof_neg_shift_pre);
  233. /* Hard Training for each CH */
  234. ddrphy_boot_run_hws(phy_base);
  235. /* DIO toffset shift after training */
  236. ddrphy_shift_tof_hws(phy_base, tof_shift);
  237. /* DIO roffset shift after training */
  238. ddrphy_shift_rof_hws(phy_base, rof_pos_shift, rof_neg_shift);
  239. /* Extend DQSGating window min:+1T max:+1T */
  240. ddrphy_ext_dqsgt(phy_base);
  241. }
  242. static void ddrphy_init(void __iomem *phy_base, enum dram_freq freq)
  243. {
  244. writel(0x40000000, phy_base + PHY_PIR);
  245. writel(0x0300C4F1, phy_base + PHY_PGCR1);
  246. writel(0x0C807D04, phy_base + PHY_PTR0);
  247. writel(0x27100578, phy_base + PHY_PTR1);
  248. writel(0x00083DEF, phy_base + PHY_PTR2);
  249. writel(0x12061A80, phy_base + PHY_PTR3);
  250. writel(0x08027100, phy_base + PHY_PTR4);
  251. writel(0x9D9CBB66, phy_base + PHY_DTPR0);
  252. writel(0x1a878400, phy_base + PHY_DTPR1);
  253. writel(0x50025200, phy_base + PHY_DTPR2);
  254. writel(0xF004641A, phy_base + PHY_DSGCR);
  255. writel(0x0000040B, phy_base + PHY_DCR);
  256. writel(0x00000d71, phy_base + PHY_MR0);
  257. writel(0x00000006, phy_base + PHY_MR1);
  258. writel(0x00000098, phy_base + PHY_MR2);
  259. writel(0x00000000, phy_base + PHY_MR3);
  260. while (!(readl(phy_base + PHY_PGSR0) & PHY_PGSR0_IDONE))
  261. cpu_relax();
  262. writel(0x00000059, phy_base + PHY_ZQ0CR1);
  263. writel(0x00000019, phy_base + PHY_ZQ1CR1);
  264. writel(0x00000019, phy_base + PHY_ZQ2CR1);
  265. writel(0x30FC6C20, phy_base + PHY_PGCR2);
  266. ddrphy_set_ckoffset_qoffset(119, 0, 0, 1, phy_base);
  267. ddrphy_set_wl_delay_dx(0, 220, 220, 1, phy_base);
  268. ddrphy_set_wl_delay_dx(1, 160, 160, 1, phy_base);
  269. ddrphy_set_wl_delay_dx(2, 190, 190, 1, phy_base);
  270. ddrphy_set_wl_delay_dx(3, 150, 150, 1, phy_base);
  271. ddrphy_set_dqsg_delay_dx(0, 750, 750, 1, phy_base);
  272. ddrphy_set_dqsg_delay_dx(1, 750, 750, 1, phy_base);
  273. ddrphy_set_dqsg_delay_dx(2, 750, 750, 1, phy_base);
  274. ddrphy_set_dqsg_delay_dx(3, 750, 750, 1, phy_base);
  275. ddrphy_set_dswb_delay_dx(0, 0, 1, phy_base);
  276. ddrphy_set_dswb_delay_dx(1, 0, 1, phy_base);
  277. ddrphy_set_dswb_delay_dx(2, 0, 1, phy_base);
  278. ddrphy_set_dswb_delay_dx(3, 0, 1, phy_base);
  279. ddrphy_set_oe_delay_dx(0, 0, 0, 1, phy_base);
  280. ddrphy_set_oe_delay_dx(1, 0, 0, 1, phy_base);
  281. ddrphy_set_oe_delay_dx(2, 0, 0, 1, phy_base);
  282. ddrphy_set_oe_delay_dx(3, 0, 0, 1, phy_base);
  283. writel(0x44000E81, phy_base + PHY_DX0GCR);
  284. writel(0x44000E81, phy_base + PHY_DX1GCR);
  285. writel(0x44000E81, phy_base + PHY_DX2GCR);
  286. writel(0x44000E81, phy_base + PHY_DX3GCR);
  287. writel(0x00055002, phy_base + PHY_DX0GTR);
  288. writel(0x00055002, phy_base + PHY_DX1GTR);
  289. writel(0x00055010, phy_base + PHY_DX2GTR);
  290. writel(0x00055010, phy_base + PHY_DX3GTR);
  291. writel(0x930035C7, phy_base + PHY_DTCR);
  292. writel(0x00000003, phy_base + PHY_PIR);
  293. readl(phy_base + PHY_PIR);
  294. while (!(readl(phy_base + PHY_PGSR0) & PHY_PGSR0_IDONE))
  295. cpu_relax();
  296. writel(0x00000181, phy_base + PHY_PIR);
  297. readl(phy_base + PHY_PIR);
  298. while (!(readl(phy_base + PHY_PGSR0) & PHY_PGSR0_IDONE))
  299. cpu_relax();
  300. writel(0x44181884, phy_base + PHY_DXCCR);
  301. writel(0x00000001, phy_base + PHY_GPR1);
  302. }
  303. /* UMC */
  304. static const u32 umc_cmdctla[DRAM_FREQ_NR] = {0x060B0B1C};
  305. static const u32 umc_cmdctlb[DRAM_FREQ_NR] = {0x27201806};
  306. static const u32 umc_cmdctlc[DRAM_FREQ_NR] = {0x00120B04};
  307. static const u32 umc_cmdctle[DRAM_FREQ_NR] = {0x00680607};
  308. static const u32 umc_cmdctlf[DRAM_FREQ_NR] = {0x02000200};
  309. static const u32 umc_cmdctlg[DRAM_FREQ_NR] = {0x08080808};
  310. static const u32 umc_rdatactl[DRAM_FREQ_NR] = {0x00000810};
  311. static const u32 umc_wdatactl[DRAM_FREQ_NR] = {0x00000004};
  312. static const u32 umc_odtctl[DRAM_FREQ_NR] = {0x02000002};
  313. static const u32 umc_acssetb[DRAM_CH_NR] = {0x00000200, 0x00000203};
  314. static const u32 umc_memconfch[DRAM_FREQ_NR] = {0x00023605};
  315. static int umc_dc_init(void __iomem *dc_base, enum dram_freq freq,
  316. unsigned long size, int ch)
  317. {
  318. /* Wait for PHY Init Complete */
  319. writel(umc_cmdctla[freq], dc_base + UMC_CMDCTLA);
  320. writel(umc_cmdctlb[freq], dc_base + UMC_CMDCTLB);
  321. writel(umc_cmdctlc[freq], dc_base + UMC_CMDCTLC);
  322. writel(umc_cmdctle[freq], dc_base + UMC_CMDCTLE);
  323. writel(umc_cmdctlf[freq], dc_base + UMC_CMDCTLF);
  324. writel(umc_cmdctlg[freq], dc_base + UMC_CMDCTLG);
  325. writel(umc_rdatactl[freq], dc_base + UMC_RDATACTL_D0);
  326. writel(umc_rdatactl[freq], dc_base + UMC_RDATACTL_D1);
  327. writel(umc_wdatactl[freq], dc_base + UMC_WDATACTL_D0);
  328. writel(umc_wdatactl[freq], dc_base + UMC_WDATACTL_D1);
  329. writel(umc_odtctl[freq], dc_base + UMC_ODTCTL_D0);
  330. writel(umc_odtctl[freq], dc_base + UMC_ODTCTL_D1);
  331. writel(0x00000003, dc_base + UMC_ACSSETA);
  332. writel(0x00000103, dc_base + UMC_FLOWCTLG);
  333. writel(umc_acssetb[ch], dc_base + UMC_ACSSETB);
  334. writel(0x02020200, dc_base + UMC_SPCSETB);
  335. writel(umc_memconfch[freq], dc_base + UMC_MEMCONFCH);
  336. writel(0x00000002, dc_base + UMC_ACFETCHCTRL);
  337. return 0;
  338. }
  339. static int umc_ch_init(void __iomem *umc_ch_base,
  340. enum dram_freq freq, unsigned long size, int ch)
  341. {
  342. void __iomem *dc_base = umc_ch_base;
  343. return umc_dc_init(dc_base, freq, size, ch);
  344. }
  345. static void um_init(void __iomem *um_base)
  346. {
  347. writel(0x00000001, um_base + UMC_SIORST);
  348. writel(0x00000001, um_base + UMC_VO0RST);
  349. writel(0x00000001, um_base + UMC_VPERST);
  350. writel(0x00000001, um_base + UMC_RGLRST);
  351. writel(0x00000001, um_base + UMC_A2DRST);
  352. writel(0x00000001, um_base + UMC_DMDRST);
  353. }
  354. int uniphier_ld11_umc_init(const struct uniphier_board_data *bd)
  355. {
  356. void __iomem *um_base = (void __iomem *)0x5B800000;
  357. void __iomem *umc_ch_base = (void __iomem *)0x5BC00000;
  358. void __iomem *phy_base = (void __iomem *)0x5BC01000;
  359. enum dram_freq freq;
  360. int ch, ret;
  361. switch (bd->dram_freq) {
  362. case 1600:
  363. freq = DRAM_FREQ_1600M;
  364. break;
  365. default:
  366. pr_err("unsupported DRAM frequency %d MHz\n", bd->dram_freq);
  367. return -EINVAL;
  368. }
  369. writel(0x00000101, umc_ch_base + UMC_DIOCTLA);
  370. while (!(readl(phy_base + PHY_PGSR0) & PHY_PGSR0_IDONE))
  371. cpu_relax();
  372. writel(0x00000000, umc_ch_base + UMC_DIOCTLA);
  373. writel(0x00000001, umc_ch_base + UMC_DEBUGC);
  374. writel(0x00000101, umc_ch_base + UMC_DIOCTLA);
  375. writel(0x00000100, umc_ch_base + UMC_INITSET);
  376. while (readl(umc_ch_base + UMC_INITSTAT) & BIT(8))
  377. cpu_relax();
  378. writel(0x00000100, umc_ch_base + 0x00200000 + UMC_INITSET);
  379. while (readl(umc_ch_base + 0x00200000 + UMC_INITSTAT) & BIT(8))
  380. cpu_relax();
  381. ddrphy_init(phy_base, freq);
  382. for (ch = 0; ch < bd->dram_nr_ch; ch++) {
  383. unsigned long size = bd->dram_ch[ch].size;
  384. unsigned int width = bd->dram_ch[ch].width;
  385. ret = umc_ch_init(umc_ch_base, freq, size / (width / 16), ch);
  386. if (ret) {
  387. pr_err("failed to initialize UMC ch%d\n", ch);
  388. return ret;
  389. }
  390. umc_ch_base += 0x00200000;
  391. }
  392. ddrphy_training(phy_base);
  393. um_init(um_base);
  394. return 0;
  395. }