setup.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Renesas - AP-325RXA
  4. * (Compatible with Algo System ., LTD. - AP-320A)
  5. *
  6. * Copyright (C) 2008 Renesas Solutions Corp.
  7. * Author : Yusuke Goda <[email protected]>
  8. */
  9. #include <asm/clock.h>
  10. #include <asm/io.h>
  11. #include <asm/suspend.h>
  12. #include <cpu/sh7723.h>
  13. #include <linux/dma-map-ops.h>
  14. #include <linux/clkdev.h>
  15. #include <linux/delay.h>
  16. #include <linux/device.h>
  17. #include <linux/gpio.h>
  18. #include <linux/gpio/machine.h>
  19. #include <linux/i2c.h>
  20. #include <linux/init.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/memblock.h>
  23. #include <linux/mfd/tmio.h>
  24. #include <linux/mmc/host.h>
  25. #include <linux/mtd/physmap.h>
  26. #include <linux/mtd/sh_flctl.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/regulator/fixed.h>
  29. #include <linux/regulator/machine.h>
  30. #include <linux/sh_intc.h>
  31. #include <linux/smsc911x.h>
  32. #include <linux/videodev2.h>
  33. #include <media/drv-intf/renesas-ceu.h>
  34. #include <media/i2c/ov772x.h>
  35. #include <video/sh_mobile_lcdc.h>
  36. #define CEU_BUFFER_MEMORY_SIZE (4 << 20)
  37. static phys_addr_t ceu_dma_membase;
  38. /* Dummy supplies, where voltage doesn't matter */
  39. static struct regulator_consumer_supply dummy_supplies[] = {
  40. REGULATOR_SUPPLY("vddvario", "smsc911x"),
  41. REGULATOR_SUPPLY("vdd33a", "smsc911x"),
  42. };
  43. static struct smsc911x_platform_config smsc911x_config = {
  44. .phy_interface = PHY_INTERFACE_MODE_MII,
  45. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  46. .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
  47. .flags = SMSC911X_USE_32BIT,
  48. };
  49. static struct resource smsc9118_resources[] = {
  50. [0] = {
  51. .start = 0xb6080000,
  52. .end = 0xb60fffff,
  53. .flags = IORESOURCE_MEM,
  54. },
  55. [1] = {
  56. .start = evt2irq(0x660),
  57. .end = evt2irq(0x660),
  58. .flags = IORESOURCE_IRQ,
  59. }
  60. };
  61. static struct platform_device smsc9118_device = {
  62. .name = "smsc911x",
  63. .id = -1,
  64. .num_resources = ARRAY_SIZE(smsc9118_resources),
  65. .resource = smsc9118_resources,
  66. .dev = {
  67. .platform_data = &smsc911x_config,
  68. },
  69. };
  70. /*
  71. * AP320 and AP325RXA has CPLD data in NOR Flash(0xA80000-0xABFFFF).
  72. * If this area erased, this board can not boot.
  73. */
  74. static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
  75. {
  76. .name = "uboot",
  77. .offset = 0,
  78. .size = (1 * 1024 * 1024),
  79. .mask_flags = MTD_WRITEABLE, /* Read-only */
  80. }, {
  81. .name = "kernel",
  82. .offset = MTDPART_OFS_APPEND,
  83. .size = (2 * 1024 * 1024),
  84. }, {
  85. .name = "free-area0",
  86. .offset = MTDPART_OFS_APPEND,
  87. .size = ((7 * 1024 * 1024) + (512 * 1024)),
  88. }, {
  89. .name = "CPLD-Data",
  90. .offset = MTDPART_OFS_APPEND,
  91. .mask_flags = MTD_WRITEABLE, /* Read-only */
  92. .size = (1024 * 128 * 2),
  93. }, {
  94. .name = "free-area1",
  95. .offset = MTDPART_OFS_APPEND,
  96. .size = MTDPART_SIZ_FULL,
  97. },
  98. };
  99. static struct physmap_flash_data ap325rxa_nor_flash_data = {
  100. .width = 2,
  101. .parts = ap325rxa_nor_flash_partitions,
  102. .nr_parts = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
  103. };
  104. static struct resource ap325rxa_nor_flash_resources[] = {
  105. [0] = {
  106. .name = "NOR Flash",
  107. .start = 0x00000000,
  108. .end = 0x00ffffff,
  109. .flags = IORESOURCE_MEM,
  110. }
  111. };
  112. static struct platform_device ap325rxa_nor_flash_device = {
  113. .name = "physmap-flash",
  114. .resource = ap325rxa_nor_flash_resources,
  115. .num_resources = ARRAY_SIZE(ap325rxa_nor_flash_resources),
  116. .dev = {
  117. .platform_data = &ap325rxa_nor_flash_data,
  118. },
  119. };
  120. static struct mtd_partition nand_partition_info[] = {
  121. {
  122. .name = "nand_data",
  123. .offset = 0,
  124. .size = MTDPART_SIZ_FULL,
  125. },
  126. };
  127. static struct resource nand_flash_resources[] = {
  128. [0] = {
  129. .start = 0xa4530000,
  130. .end = 0xa45300ff,
  131. .flags = IORESOURCE_MEM,
  132. }
  133. };
  134. static struct sh_flctl_platform_data nand_flash_data = {
  135. .parts = nand_partition_info,
  136. .nr_parts = ARRAY_SIZE(nand_partition_info),
  137. .flcmncr_val = FCKSEL_E | TYPESEL_SET | NANWF_E,
  138. .has_hwecc = 1,
  139. };
  140. static struct platform_device nand_flash_device = {
  141. .name = "sh_flctl",
  142. .resource = nand_flash_resources,
  143. .num_resources = ARRAY_SIZE(nand_flash_resources),
  144. .dev = {
  145. .platform_data = &nand_flash_data,
  146. },
  147. };
  148. #define FPGA_LCDREG 0xB4100180
  149. #define FPGA_BKLREG 0xB4100212
  150. #define FPGA_LCDREG_VAL 0x0018
  151. #define PORT_MSELCRB 0xA4050182
  152. #define PORT_HIZCRC 0xA405015C
  153. #define PORT_DRVCRA 0xA405018A
  154. #define PORT_DRVCRB 0xA405018C
  155. static int ap320_wvga_set_brightness(int brightness)
  156. {
  157. if (brightness) {
  158. gpio_set_value(GPIO_PTS3, 0);
  159. __raw_writew(0x100, FPGA_BKLREG);
  160. } else {
  161. __raw_writew(0, FPGA_BKLREG);
  162. gpio_set_value(GPIO_PTS3, 1);
  163. }
  164. return 0;
  165. }
  166. static void ap320_wvga_power_on(void)
  167. {
  168. msleep(100);
  169. /* ASD AP-320/325 LCD ON */
  170. __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
  171. }
  172. static void ap320_wvga_power_off(void)
  173. {
  174. /* ASD AP-320/325 LCD OFF */
  175. __raw_writew(0, FPGA_LCDREG);
  176. }
  177. static const struct fb_videomode ap325rxa_lcdc_modes[] = {
  178. {
  179. .name = "LB070WV1",
  180. .xres = 800,
  181. .yres = 480,
  182. .left_margin = 32,
  183. .right_margin = 160,
  184. .hsync_len = 8,
  185. .upper_margin = 63,
  186. .lower_margin = 80,
  187. .vsync_len = 1,
  188. .sync = 0, /* hsync and vsync are active low */
  189. },
  190. };
  191. static struct sh_mobile_lcdc_info lcdc_info = {
  192. .clock_source = LCDC_CLK_EXTERNAL,
  193. .ch[0] = {
  194. .chan = LCDC_CHAN_MAINLCD,
  195. .fourcc = V4L2_PIX_FMT_RGB565,
  196. .interface_type = RGB18,
  197. .clock_divider = 1,
  198. .lcd_modes = ap325rxa_lcdc_modes,
  199. .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes),
  200. .panel_cfg = {
  201. .width = 152, /* 7.0 inch */
  202. .height = 91,
  203. .display_on = ap320_wvga_power_on,
  204. .display_off = ap320_wvga_power_off,
  205. },
  206. .bl_info = {
  207. .name = "sh_mobile_lcdc_bl",
  208. .max_brightness = 1,
  209. .set_brightness = ap320_wvga_set_brightness,
  210. },
  211. }
  212. };
  213. static struct resource lcdc_resources[] = {
  214. [0] = {
  215. .name = "LCDC",
  216. .start = 0xfe940000, /* P4-only space */
  217. .end = 0xfe942fff,
  218. .flags = IORESOURCE_MEM,
  219. },
  220. [1] = {
  221. .start = evt2irq(0x580),
  222. .flags = IORESOURCE_IRQ,
  223. },
  224. };
  225. static struct platform_device lcdc_device = {
  226. .name = "sh_mobile_lcdc_fb",
  227. .num_resources = ARRAY_SIZE(lcdc_resources),
  228. .resource = lcdc_resources,
  229. .dev = {
  230. .platform_data = &lcdc_info,
  231. },
  232. };
  233. /* Powerdown/reset gpios for CEU image sensors */
  234. static struct gpiod_lookup_table ov7725_gpios = {
  235. .dev_id = "0-0021",
  236. .table = {
  237. GPIO_LOOKUP("sh7723_pfc", GPIO_PTZ5, "reset", GPIO_ACTIVE_LOW),
  238. },
  239. };
  240. static struct ceu_platform_data ceu0_pdata = {
  241. .num_subdevs = 1,
  242. .subdevs = {
  243. { /* [0] = ov7725 */
  244. .flags = 0,
  245. .bus_width = 8,
  246. .bus_shift = 0,
  247. .i2c_adapter_id = 0,
  248. .i2c_address = 0x21,
  249. },
  250. },
  251. };
  252. static struct resource ceu_resources[] = {
  253. [0] = {
  254. .name = "CEU",
  255. .start = 0xfe910000,
  256. .end = 0xfe91009f,
  257. .flags = IORESOURCE_MEM,
  258. },
  259. [1] = {
  260. .start = evt2irq(0x880),
  261. .flags = IORESOURCE_IRQ,
  262. },
  263. };
  264. static struct platform_device ap325rxa_ceu_device = {
  265. .name = "renesas-ceu",
  266. .id = 0, /* "ceu.0" clock */
  267. .num_resources = ARRAY_SIZE(ceu_resources),
  268. .resource = ceu_resources,
  269. .dev = {
  270. .platform_data = &ceu0_pdata,
  271. },
  272. };
  273. /* Fixed 3.3V regulators to be used by SDHI0, SDHI1 */
  274. static struct regulator_consumer_supply fixed3v3_power_consumers[] =
  275. {
  276. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
  277. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
  278. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
  279. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
  280. };
  281. static struct resource sdhi0_cn3_resources[] = {
  282. [0] = {
  283. .name = "SDHI0",
  284. .start = 0x04ce0000,
  285. .end = 0x04ce00ff,
  286. .flags = IORESOURCE_MEM,
  287. },
  288. [1] = {
  289. .start = evt2irq(0xe80),
  290. .flags = IORESOURCE_IRQ,
  291. },
  292. };
  293. static struct tmio_mmc_data sdhi0_cn3_data = {
  294. .capabilities = MMC_CAP_SDIO_IRQ,
  295. };
  296. static struct platform_device sdhi0_cn3_device = {
  297. .name = "sh_mobile_sdhi",
  298. .id = 0, /* "sdhi0" clock */
  299. .num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
  300. .resource = sdhi0_cn3_resources,
  301. .dev = {
  302. .platform_data = &sdhi0_cn3_data,
  303. },
  304. };
  305. static struct resource sdhi1_cn7_resources[] = {
  306. [0] = {
  307. .name = "SDHI1",
  308. .start = 0x04cf0000,
  309. .end = 0x04cf00ff,
  310. .flags = IORESOURCE_MEM,
  311. },
  312. [1] = {
  313. .start = evt2irq(0x4e0),
  314. .flags = IORESOURCE_IRQ,
  315. },
  316. };
  317. static struct tmio_mmc_data sdhi1_cn7_data = {
  318. .capabilities = MMC_CAP_SDIO_IRQ,
  319. };
  320. static struct platform_device sdhi1_cn7_device = {
  321. .name = "sh_mobile_sdhi",
  322. .id = 1, /* "sdhi1" clock */
  323. .num_resources = ARRAY_SIZE(sdhi1_cn7_resources),
  324. .resource = sdhi1_cn7_resources,
  325. .dev = {
  326. .platform_data = &sdhi1_cn7_data,
  327. },
  328. };
  329. static struct ov772x_camera_info ov7725_info = {
  330. .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
  331. .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
  332. };
  333. static struct i2c_board_info ap325rxa_i2c_devices[] __initdata = {
  334. {
  335. I2C_BOARD_INFO("pcf8563", 0x51),
  336. },
  337. {
  338. I2C_BOARD_INFO("ov772x", 0x21),
  339. .platform_data = &ov7725_info,
  340. },
  341. };
  342. static struct platform_device *ap325rxa_devices[] __initdata = {
  343. &smsc9118_device,
  344. &ap325rxa_nor_flash_device,
  345. &lcdc_device,
  346. &nand_flash_device,
  347. &sdhi0_cn3_device,
  348. &sdhi1_cn7_device,
  349. };
  350. extern char ap325rxa_sdram_enter_start;
  351. extern char ap325rxa_sdram_enter_end;
  352. extern char ap325rxa_sdram_leave_start;
  353. extern char ap325rxa_sdram_leave_end;
  354. static int __init ap325rxa_devices_setup(void)
  355. {
  356. /* register board specific self-refresh code */
  357. sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
  358. &ap325rxa_sdram_enter_start,
  359. &ap325rxa_sdram_enter_end,
  360. &ap325rxa_sdram_leave_start,
  361. &ap325rxa_sdram_leave_end);
  362. regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
  363. ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
  364. regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
  365. /* LD3 and LD4 LEDs */
  366. gpio_request(GPIO_PTX5, NULL); /* RUN */
  367. gpio_direction_output(GPIO_PTX5, 1);
  368. gpio_export(GPIO_PTX5, 0);
  369. gpio_request(GPIO_PTX4, NULL); /* INDICATOR */
  370. gpio_direction_output(GPIO_PTX4, 0);
  371. gpio_export(GPIO_PTX4, 0);
  372. /* SW1 input */
  373. gpio_request(GPIO_PTF7, NULL); /* MODE */
  374. gpio_direction_input(GPIO_PTF7);
  375. gpio_export(GPIO_PTF7, 0);
  376. /* LCDC */
  377. gpio_request(GPIO_FN_LCDD15, NULL);
  378. gpio_request(GPIO_FN_LCDD14, NULL);
  379. gpio_request(GPIO_FN_LCDD13, NULL);
  380. gpio_request(GPIO_FN_LCDD12, NULL);
  381. gpio_request(GPIO_FN_LCDD11, NULL);
  382. gpio_request(GPIO_FN_LCDD10, NULL);
  383. gpio_request(GPIO_FN_LCDD9, NULL);
  384. gpio_request(GPIO_FN_LCDD8, NULL);
  385. gpio_request(GPIO_FN_LCDD7, NULL);
  386. gpio_request(GPIO_FN_LCDD6, NULL);
  387. gpio_request(GPIO_FN_LCDD5, NULL);
  388. gpio_request(GPIO_FN_LCDD4, NULL);
  389. gpio_request(GPIO_FN_LCDD3, NULL);
  390. gpio_request(GPIO_FN_LCDD2, NULL);
  391. gpio_request(GPIO_FN_LCDD1, NULL);
  392. gpio_request(GPIO_FN_LCDD0, NULL);
  393. gpio_request(GPIO_FN_LCDLCLK_PTR, NULL);
  394. gpio_request(GPIO_FN_LCDDCK, NULL);
  395. gpio_request(GPIO_FN_LCDVEPWC, NULL);
  396. gpio_request(GPIO_FN_LCDVCPWC, NULL);
  397. gpio_request(GPIO_FN_LCDVSYN, NULL);
  398. gpio_request(GPIO_FN_LCDHSYN, NULL);
  399. gpio_request(GPIO_FN_LCDDISP, NULL);
  400. gpio_request(GPIO_FN_LCDDON, NULL);
  401. /* LCD backlight */
  402. gpio_request(GPIO_PTS3, NULL);
  403. gpio_direction_output(GPIO_PTS3, 1);
  404. /* CEU */
  405. gpio_request(GPIO_FN_VIO_CLK2, NULL);
  406. gpio_request(GPIO_FN_VIO_VD2, NULL);
  407. gpio_request(GPIO_FN_VIO_HD2, NULL);
  408. gpio_request(GPIO_FN_VIO_FLD, NULL);
  409. gpio_request(GPIO_FN_VIO_CKO, NULL);
  410. gpio_request(GPIO_FN_VIO_D15, NULL);
  411. gpio_request(GPIO_FN_VIO_D14, NULL);
  412. gpio_request(GPIO_FN_VIO_D13, NULL);
  413. gpio_request(GPIO_FN_VIO_D12, NULL);
  414. gpio_request(GPIO_FN_VIO_D11, NULL);
  415. gpio_request(GPIO_FN_VIO_D10, NULL);
  416. gpio_request(GPIO_FN_VIO_D9, NULL);
  417. gpio_request(GPIO_FN_VIO_D8, NULL);
  418. gpio_request(GPIO_PTZ7, NULL);
  419. gpio_direction_output(GPIO_PTZ7, 0); /* OE_CAM */
  420. gpio_request(GPIO_PTZ6, NULL);
  421. gpio_direction_output(GPIO_PTZ6, 0); /* STBY_CAM */
  422. gpio_request(GPIO_PTZ5, NULL);
  423. gpio_direction_output(GPIO_PTZ5, 0); /* RST_CAM */
  424. gpio_request(GPIO_PTZ4, NULL);
  425. gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */
  426. __raw_writew(__raw_readw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB);
  427. /* FLCTL */
  428. gpio_request(GPIO_FN_FCE, NULL);
  429. gpio_request(GPIO_FN_NAF7, NULL);
  430. gpio_request(GPIO_FN_NAF6, NULL);
  431. gpio_request(GPIO_FN_NAF5, NULL);
  432. gpio_request(GPIO_FN_NAF4, NULL);
  433. gpio_request(GPIO_FN_NAF3, NULL);
  434. gpio_request(GPIO_FN_NAF2, NULL);
  435. gpio_request(GPIO_FN_NAF1, NULL);
  436. gpio_request(GPIO_FN_NAF0, NULL);
  437. gpio_request(GPIO_FN_FCDE, NULL);
  438. gpio_request(GPIO_FN_FOE, NULL);
  439. gpio_request(GPIO_FN_FSC, NULL);
  440. gpio_request(GPIO_FN_FWE, NULL);
  441. gpio_request(GPIO_FN_FRB, NULL);
  442. __raw_writew(0, PORT_HIZCRC);
  443. __raw_writew(0xFFFF, PORT_DRVCRA);
  444. __raw_writew(0xFFFF, PORT_DRVCRB);
  445. /* SDHI0 - CN3 - SD CARD */
  446. gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
  447. gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
  448. gpio_request(GPIO_FN_SDHI0D3_PTD, NULL);
  449. gpio_request(GPIO_FN_SDHI0D2_PTD, NULL);
  450. gpio_request(GPIO_FN_SDHI0D1_PTD, NULL);
  451. gpio_request(GPIO_FN_SDHI0D0_PTD, NULL);
  452. gpio_request(GPIO_FN_SDHI0CMD_PTD, NULL);
  453. gpio_request(GPIO_FN_SDHI0CLK_PTD, NULL);
  454. /* SDHI1 - CN7 - MICRO SD CARD */
  455. gpio_request(GPIO_FN_SDHI1CD, NULL);
  456. gpio_request(GPIO_FN_SDHI1D3, NULL);
  457. gpio_request(GPIO_FN_SDHI1D2, NULL);
  458. gpio_request(GPIO_FN_SDHI1D1, NULL);
  459. gpio_request(GPIO_FN_SDHI1D0, NULL);
  460. gpio_request(GPIO_FN_SDHI1CMD, NULL);
  461. gpio_request(GPIO_FN_SDHI1CLK, NULL);
  462. /* Add a clock alias for ov7725 xclk source. */
  463. clk_add_alias(NULL, "0-0021", "video_clk", NULL);
  464. /* Register RSTB gpio for ov7725 camera sensor. */
  465. gpiod_add_lookup_table(&ov7725_gpios);
  466. i2c_register_board_info(0, ap325rxa_i2c_devices,
  467. ARRAY_SIZE(ap325rxa_i2c_devices));
  468. /* Initialize CEU platform device separately to map memory first */
  469. device_initialize(&ap325rxa_ceu_device.dev);
  470. dma_declare_coherent_memory(&ap325rxa_ceu_device.dev,
  471. ceu_dma_membase, ceu_dma_membase,
  472. CEU_BUFFER_MEMORY_SIZE);
  473. platform_device_add(&ap325rxa_ceu_device);
  474. return platform_add_devices(ap325rxa_devices,
  475. ARRAY_SIZE(ap325rxa_devices));
  476. }
  477. arch_initcall(ap325rxa_devices_setup);
  478. /* Return the board specific boot mode pin configuration */
  479. static int ap325rxa_mode_pins(void)
  480. {
  481. /* MD0=0, MD1=0, MD2=0: Clock Mode 0
  482. * MD3=0: 16-bit Area0 Bus Width
  483. * MD5=1: Little Endian
  484. * TSTMD=1, MD8=1: Test Mode Disabled
  485. */
  486. return MODE_PIN5 | MODE_PIN8;
  487. }
  488. /* Reserve a portion of memory for CEU buffers */
  489. static void __init ap325rxa_mv_mem_reserve(void)
  490. {
  491. phys_addr_t phys;
  492. phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
  493. phys = memblock_phys_alloc(size, PAGE_SIZE);
  494. if (!phys)
  495. panic("Failed to allocate CEU memory\n");
  496. memblock_phys_free(phys, size);
  497. memblock_remove(phys, size);
  498. ceu_dma_membase = phys;
  499. }
  500. static struct sh_machine_vector mv_ap325rxa __initmv = {
  501. .mv_name = "AP-325RXA",
  502. .mv_mode_pins = ap325rxa_mode_pins,
  503. .mv_mem_reserve = ap325rxa_mv_mem_reserve,
  504. };