18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Prototypes, etc. for the Freescale MPC52xx embedded cpu chips 38c2ecf20Sopenharmony_ci * May need to be cleaned as the port goes on ... 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2004-2005 Sylvain Munaut <tnt@246tNt.com> 68c2ecf20Sopenharmony_ci * Copyright (C) 2003 MontaVista, Software, Inc. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public License 98c2ecf20Sopenharmony_ci * version 2. This program is licensed "as is" without any warranty of any 108c2ecf20Sopenharmony_ci * kind, whether express or implied. 118c2ecf20Sopenharmony_ci */ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#ifndef __ASM_POWERPC_MPC52xx_H__ 148c2ecf20Sopenharmony_ci#define __ASM_POWERPC_MPC52xx_H__ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 178c2ecf20Sopenharmony_ci#include <asm/types.h> 188c2ecf20Sopenharmony_ci#include <asm/prom.h> 198c2ecf20Sopenharmony_ci#include <asm/mpc5xxx.h> 208c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */ 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#include <linux/suspend.h> 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci/* Variants of the 5200(B) */ 258c2ecf20Sopenharmony_ci#define MPC5200_SVR 0x80110010 268c2ecf20Sopenharmony_ci#define MPC5200_SVR_MASK 0xfffffff0 278c2ecf20Sopenharmony_ci#define MPC5200B_SVR 0x80110020 288c2ecf20Sopenharmony_ci#define MPC5200B_SVR_MASK 0xfffffff0 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* ======================================================================== */ 318c2ecf20Sopenharmony_ci/* Structures mapping of some unit register set */ 328c2ecf20Sopenharmony_ci/* ======================================================================== */ 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci/* Memory Mapping Control */ 378c2ecf20Sopenharmony_cistruct mpc52xx_mmap_ctl { 388c2ecf20Sopenharmony_ci u32 mbar; /* MMAP_CTRL + 0x00 */ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci u32 cs0_start; /* MMAP_CTRL + 0x04 */ 418c2ecf20Sopenharmony_ci u32 cs0_stop; /* MMAP_CTRL + 0x08 */ 428c2ecf20Sopenharmony_ci u32 cs1_start; /* MMAP_CTRL + 0x0c */ 438c2ecf20Sopenharmony_ci u32 cs1_stop; /* MMAP_CTRL + 0x10 */ 448c2ecf20Sopenharmony_ci u32 cs2_start; /* MMAP_CTRL + 0x14 */ 458c2ecf20Sopenharmony_ci u32 cs2_stop; /* MMAP_CTRL + 0x18 */ 468c2ecf20Sopenharmony_ci u32 cs3_start; /* MMAP_CTRL + 0x1c */ 478c2ecf20Sopenharmony_ci u32 cs3_stop; /* MMAP_CTRL + 0x20 */ 488c2ecf20Sopenharmony_ci u32 cs4_start; /* MMAP_CTRL + 0x24 */ 498c2ecf20Sopenharmony_ci u32 cs4_stop; /* MMAP_CTRL + 0x28 */ 508c2ecf20Sopenharmony_ci u32 cs5_start; /* MMAP_CTRL + 0x2c */ 518c2ecf20Sopenharmony_ci u32 cs5_stop; /* MMAP_CTRL + 0x30 */ 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci u32 sdram0; /* MMAP_CTRL + 0x34 */ 548c2ecf20Sopenharmony_ci u32 sdram1; /* MMAP_CTRL + 0X38 */ 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci u32 reserved[4]; /* MMAP_CTRL + 0x3c .. 0x48 */ 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci u32 boot_start; /* MMAP_CTRL + 0x4c */ 598c2ecf20Sopenharmony_ci u32 boot_stop; /* MMAP_CTRL + 0x50 */ 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci u32 ipbi_ws_ctrl; /* MMAP_CTRL + 0x54 */ 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci u32 cs6_start; /* MMAP_CTRL + 0x58 */ 648c2ecf20Sopenharmony_ci u32 cs6_stop; /* MMAP_CTRL + 0x5c */ 658c2ecf20Sopenharmony_ci u32 cs7_start; /* MMAP_CTRL + 0x60 */ 668c2ecf20Sopenharmony_ci u32 cs7_stop; /* MMAP_CTRL + 0x64 */ 678c2ecf20Sopenharmony_ci}; 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci/* SDRAM control */ 708c2ecf20Sopenharmony_cistruct mpc52xx_sdram { 718c2ecf20Sopenharmony_ci u32 mode; /* SDRAM + 0x00 */ 728c2ecf20Sopenharmony_ci u32 ctrl; /* SDRAM + 0x04 */ 738c2ecf20Sopenharmony_ci u32 config1; /* SDRAM + 0x08 */ 748c2ecf20Sopenharmony_ci u32 config2; /* SDRAM + 0x0c */ 758c2ecf20Sopenharmony_ci}; 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci/* SDMA */ 788c2ecf20Sopenharmony_cistruct mpc52xx_sdma { 798c2ecf20Sopenharmony_ci u32 taskBar; /* SDMA + 0x00 */ 808c2ecf20Sopenharmony_ci u32 currentPointer; /* SDMA + 0x04 */ 818c2ecf20Sopenharmony_ci u32 endPointer; /* SDMA + 0x08 */ 828c2ecf20Sopenharmony_ci u32 variablePointer; /* SDMA + 0x0c */ 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci u8 IntVect1; /* SDMA + 0x10 */ 858c2ecf20Sopenharmony_ci u8 IntVect2; /* SDMA + 0x11 */ 868c2ecf20Sopenharmony_ci u16 PtdCntrl; /* SDMA + 0x12 */ 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci u32 IntPend; /* SDMA + 0x14 */ 898c2ecf20Sopenharmony_ci u32 IntMask; /* SDMA + 0x18 */ 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci u16 tcr[16]; /* SDMA + 0x1c .. 0x3a */ 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci u8 ipr[32]; /* SDMA + 0x3c .. 0x5b */ 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci u32 cReqSelect; /* SDMA + 0x5c */ 968c2ecf20Sopenharmony_ci u32 task_size0; /* SDMA + 0x60 */ 978c2ecf20Sopenharmony_ci u32 task_size1; /* SDMA + 0x64 */ 988c2ecf20Sopenharmony_ci u32 MDEDebug; /* SDMA + 0x68 */ 998c2ecf20Sopenharmony_ci u32 ADSDebug; /* SDMA + 0x6c */ 1008c2ecf20Sopenharmony_ci u32 Value1; /* SDMA + 0x70 */ 1018c2ecf20Sopenharmony_ci u32 Value2; /* SDMA + 0x74 */ 1028c2ecf20Sopenharmony_ci u32 Control; /* SDMA + 0x78 */ 1038c2ecf20Sopenharmony_ci u32 Status; /* SDMA + 0x7c */ 1048c2ecf20Sopenharmony_ci u32 PTDDebug; /* SDMA + 0x80 */ 1058c2ecf20Sopenharmony_ci}; 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci/* GPT */ 1088c2ecf20Sopenharmony_cistruct mpc52xx_gpt { 1098c2ecf20Sopenharmony_ci u32 mode; /* GPTx + 0x00 */ 1108c2ecf20Sopenharmony_ci u32 count; /* GPTx + 0x04 */ 1118c2ecf20Sopenharmony_ci u32 pwm; /* GPTx + 0x08 */ 1128c2ecf20Sopenharmony_ci u32 status; /* GPTx + 0X0c */ 1138c2ecf20Sopenharmony_ci}; 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci/* GPIO */ 1168c2ecf20Sopenharmony_cistruct mpc52xx_gpio { 1178c2ecf20Sopenharmony_ci u32 port_config; /* GPIO + 0x00 */ 1188c2ecf20Sopenharmony_ci u32 simple_gpioe; /* GPIO + 0x04 */ 1198c2ecf20Sopenharmony_ci u32 simple_ode; /* GPIO + 0x08 */ 1208c2ecf20Sopenharmony_ci u32 simple_ddr; /* GPIO + 0x0c */ 1218c2ecf20Sopenharmony_ci u32 simple_dvo; /* GPIO + 0x10 */ 1228c2ecf20Sopenharmony_ci u32 simple_ival; /* GPIO + 0x14 */ 1238c2ecf20Sopenharmony_ci u8 outo_gpioe; /* GPIO + 0x18 */ 1248c2ecf20Sopenharmony_ci u8 reserved1[3]; /* GPIO + 0x19 */ 1258c2ecf20Sopenharmony_ci u8 outo_dvo; /* GPIO + 0x1c */ 1268c2ecf20Sopenharmony_ci u8 reserved2[3]; /* GPIO + 0x1d */ 1278c2ecf20Sopenharmony_ci u8 sint_gpioe; /* GPIO + 0x20 */ 1288c2ecf20Sopenharmony_ci u8 reserved3[3]; /* GPIO + 0x21 */ 1298c2ecf20Sopenharmony_ci u8 sint_ode; /* GPIO + 0x24 */ 1308c2ecf20Sopenharmony_ci u8 reserved4[3]; /* GPIO + 0x25 */ 1318c2ecf20Sopenharmony_ci u8 sint_ddr; /* GPIO + 0x28 */ 1328c2ecf20Sopenharmony_ci u8 reserved5[3]; /* GPIO + 0x29 */ 1338c2ecf20Sopenharmony_ci u8 sint_dvo; /* GPIO + 0x2c */ 1348c2ecf20Sopenharmony_ci u8 reserved6[3]; /* GPIO + 0x2d */ 1358c2ecf20Sopenharmony_ci u8 sint_inten; /* GPIO + 0x30 */ 1368c2ecf20Sopenharmony_ci u8 reserved7[3]; /* GPIO + 0x31 */ 1378c2ecf20Sopenharmony_ci u16 sint_itype; /* GPIO + 0x34 */ 1388c2ecf20Sopenharmony_ci u16 reserved8; /* GPIO + 0x36 */ 1398c2ecf20Sopenharmony_ci u8 gpio_control; /* GPIO + 0x38 */ 1408c2ecf20Sopenharmony_ci u8 reserved9[3]; /* GPIO + 0x39 */ 1418c2ecf20Sopenharmony_ci u8 sint_istat; /* GPIO + 0x3c */ 1428c2ecf20Sopenharmony_ci u8 sint_ival; /* GPIO + 0x3d */ 1438c2ecf20Sopenharmony_ci u8 bus_errs; /* GPIO + 0x3e */ 1448c2ecf20Sopenharmony_ci u8 reserved10; /* GPIO + 0x3f */ 1458c2ecf20Sopenharmony_ci}; 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci#define MPC52xx_GPIO_PSC_CONFIG_UART_WITHOUT_CD 4 1488c2ecf20Sopenharmony_ci#define MPC52xx_GPIO_PSC_CONFIG_UART_WITH_CD 5 1498c2ecf20Sopenharmony_ci#define MPC52xx_GPIO_PCI_DIS (1<<15) 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci/* GPIO with WakeUp*/ 1528c2ecf20Sopenharmony_cistruct mpc52xx_gpio_wkup { 1538c2ecf20Sopenharmony_ci u8 wkup_gpioe; /* GPIO_WKUP + 0x00 */ 1548c2ecf20Sopenharmony_ci u8 reserved1[3]; /* GPIO_WKUP + 0x03 */ 1558c2ecf20Sopenharmony_ci u8 wkup_ode; /* GPIO_WKUP + 0x04 */ 1568c2ecf20Sopenharmony_ci u8 reserved2[3]; /* GPIO_WKUP + 0x05 */ 1578c2ecf20Sopenharmony_ci u8 wkup_ddr; /* GPIO_WKUP + 0x08 */ 1588c2ecf20Sopenharmony_ci u8 reserved3[3]; /* GPIO_WKUP + 0x09 */ 1598c2ecf20Sopenharmony_ci u8 wkup_dvo; /* GPIO_WKUP + 0x0C */ 1608c2ecf20Sopenharmony_ci u8 reserved4[3]; /* GPIO_WKUP + 0x0D */ 1618c2ecf20Sopenharmony_ci u8 wkup_inten; /* GPIO_WKUP + 0x10 */ 1628c2ecf20Sopenharmony_ci u8 reserved5[3]; /* GPIO_WKUP + 0x11 */ 1638c2ecf20Sopenharmony_ci u8 wkup_iinten; /* GPIO_WKUP + 0x14 */ 1648c2ecf20Sopenharmony_ci u8 reserved6[3]; /* GPIO_WKUP + 0x15 */ 1658c2ecf20Sopenharmony_ci u16 wkup_itype; /* GPIO_WKUP + 0x18 */ 1668c2ecf20Sopenharmony_ci u8 reserved7[2]; /* GPIO_WKUP + 0x1A */ 1678c2ecf20Sopenharmony_ci u8 wkup_maste; /* GPIO_WKUP + 0x1C */ 1688c2ecf20Sopenharmony_ci u8 reserved8[3]; /* GPIO_WKUP + 0x1D */ 1698c2ecf20Sopenharmony_ci u8 wkup_ival; /* GPIO_WKUP + 0x20 */ 1708c2ecf20Sopenharmony_ci u8 reserved9[3]; /* GPIO_WKUP + 0x21 */ 1718c2ecf20Sopenharmony_ci u8 wkup_istat; /* GPIO_WKUP + 0x24 */ 1728c2ecf20Sopenharmony_ci u8 reserved10[3]; /* GPIO_WKUP + 0x25 */ 1738c2ecf20Sopenharmony_ci}; 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_ci/* XLB Bus control */ 1768c2ecf20Sopenharmony_cistruct mpc52xx_xlb { 1778c2ecf20Sopenharmony_ci u8 reserved[0x40]; 1788c2ecf20Sopenharmony_ci u32 config; /* XLB + 0x40 */ 1798c2ecf20Sopenharmony_ci u32 version; /* XLB + 0x44 */ 1808c2ecf20Sopenharmony_ci u32 status; /* XLB + 0x48 */ 1818c2ecf20Sopenharmony_ci u32 int_enable; /* XLB + 0x4c */ 1828c2ecf20Sopenharmony_ci u32 addr_capture; /* XLB + 0x50 */ 1838c2ecf20Sopenharmony_ci u32 bus_sig_capture; /* XLB + 0x54 */ 1848c2ecf20Sopenharmony_ci u32 addr_timeout; /* XLB + 0x58 */ 1858c2ecf20Sopenharmony_ci u32 data_timeout; /* XLB + 0x5c */ 1868c2ecf20Sopenharmony_ci u32 bus_act_timeout; /* XLB + 0x60 */ 1878c2ecf20Sopenharmony_ci u32 master_pri_enable; /* XLB + 0x64 */ 1888c2ecf20Sopenharmony_ci u32 master_priority; /* XLB + 0x68 */ 1898c2ecf20Sopenharmony_ci u32 base_address; /* XLB + 0x6c */ 1908c2ecf20Sopenharmony_ci u32 snoop_window; /* XLB + 0x70 */ 1918c2ecf20Sopenharmony_ci}; 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci#define MPC52xx_XLB_CFG_PLDIS (1 << 31) 1948c2ecf20Sopenharmony_ci#define MPC52xx_XLB_CFG_SNOOP (1 << 15) 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ci/* Clock Distribution control */ 1978c2ecf20Sopenharmony_cistruct mpc52xx_cdm { 1988c2ecf20Sopenharmony_ci u32 jtag_id; /* CDM + 0x00 reg0 read only */ 1998c2ecf20Sopenharmony_ci u32 rstcfg; /* CDM + 0x04 reg1 read only */ 2008c2ecf20Sopenharmony_ci u32 breadcrumb; /* CDM + 0x08 reg2 */ 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ci u8 mem_clk_sel; /* CDM + 0x0c reg3 byte0 */ 2038c2ecf20Sopenharmony_ci u8 xlb_clk_sel; /* CDM + 0x0d reg3 byte1 read only */ 2048c2ecf20Sopenharmony_ci u8 ipb_clk_sel; /* CDM + 0x0e reg3 byte2 */ 2058c2ecf20Sopenharmony_ci u8 pci_clk_sel; /* CDM + 0x0f reg3 byte3 */ 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci u8 ext_48mhz_en; /* CDM + 0x10 reg4 byte0 */ 2088c2ecf20Sopenharmony_ci u8 fd_enable; /* CDM + 0x11 reg4 byte1 */ 2098c2ecf20Sopenharmony_ci u16 fd_counters; /* CDM + 0x12 reg4 byte2,3 */ 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci u32 clk_enables; /* CDM + 0x14 reg5 */ 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci u8 osc_disable; /* CDM + 0x18 reg6 byte0 */ 2148c2ecf20Sopenharmony_ci u8 reserved0[3]; /* CDM + 0x19 reg6 byte1,2,3 */ 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci u8 ccs_sleep_enable; /* CDM + 0x1c reg7 byte0 */ 2178c2ecf20Sopenharmony_ci u8 osc_sleep_enable; /* CDM + 0x1d reg7 byte1 */ 2188c2ecf20Sopenharmony_ci u8 reserved1; /* CDM + 0x1e reg7 byte2 */ 2198c2ecf20Sopenharmony_ci u8 ccs_qreq_test; /* CDM + 0x1f reg7 byte3 */ 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci u8 soft_reset; /* CDM + 0x20 u8 byte0 */ 2228c2ecf20Sopenharmony_ci u8 no_ckstp; /* CDM + 0x21 u8 byte0 */ 2238c2ecf20Sopenharmony_ci u8 reserved2[2]; /* CDM + 0x22 u8 byte1,2,3 */ 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_ci u8 pll_lock; /* CDM + 0x24 reg9 byte0 */ 2268c2ecf20Sopenharmony_ci u8 pll_looselock; /* CDM + 0x25 reg9 byte1 */ 2278c2ecf20Sopenharmony_ci u8 pll_sm_lockwin; /* CDM + 0x26 reg9 byte2 */ 2288c2ecf20Sopenharmony_ci u8 reserved3; /* CDM + 0x27 reg9 byte3 */ 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci u16 reserved4; /* CDM + 0x28 reg10 byte0,1 */ 2318c2ecf20Sopenharmony_ci u16 mclken_div_psc1; /* CDM + 0x2a reg10 byte2,3 */ 2328c2ecf20Sopenharmony_ci 2338c2ecf20Sopenharmony_ci u16 reserved5; /* CDM + 0x2c reg11 byte0,1 */ 2348c2ecf20Sopenharmony_ci u16 mclken_div_psc2; /* CDM + 0x2e reg11 byte2,3 */ 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_ci u16 reserved6; /* CDM + 0x30 reg12 byte0,1 */ 2378c2ecf20Sopenharmony_ci u16 mclken_div_psc3; /* CDM + 0x32 reg12 byte2,3 */ 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci u16 reserved7; /* CDM + 0x34 reg13 byte0,1 */ 2408c2ecf20Sopenharmony_ci u16 mclken_div_psc6; /* CDM + 0x36 reg13 byte2,3 */ 2418c2ecf20Sopenharmony_ci}; 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci/* Interrupt controller Register set */ 2448c2ecf20Sopenharmony_cistruct mpc52xx_intr { 2458c2ecf20Sopenharmony_ci u32 per_mask; /* INTR + 0x00 */ 2468c2ecf20Sopenharmony_ci u32 per_pri1; /* INTR + 0x04 */ 2478c2ecf20Sopenharmony_ci u32 per_pri2; /* INTR + 0x08 */ 2488c2ecf20Sopenharmony_ci u32 per_pri3; /* INTR + 0x0c */ 2498c2ecf20Sopenharmony_ci u32 ctrl; /* INTR + 0x10 */ 2508c2ecf20Sopenharmony_ci u32 main_mask; /* INTR + 0x14 */ 2518c2ecf20Sopenharmony_ci u32 main_pri1; /* INTR + 0x18 */ 2528c2ecf20Sopenharmony_ci u32 main_pri2; /* INTR + 0x1c */ 2538c2ecf20Sopenharmony_ci u32 reserved1; /* INTR + 0x20 */ 2548c2ecf20Sopenharmony_ci u32 enc_status; /* INTR + 0x24 */ 2558c2ecf20Sopenharmony_ci u32 crit_status; /* INTR + 0x28 */ 2568c2ecf20Sopenharmony_ci u32 main_status; /* INTR + 0x2c */ 2578c2ecf20Sopenharmony_ci u32 per_status; /* INTR + 0x30 */ 2588c2ecf20Sopenharmony_ci u32 reserved2; /* INTR + 0x34 */ 2598c2ecf20Sopenharmony_ci u32 per_error; /* INTR + 0x38 */ 2608c2ecf20Sopenharmony_ci}; 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */ 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci/* ========================================================================= */ 2668c2ecf20Sopenharmony_ci/* Prototypes for MPC52xx sysdev */ 2678c2ecf20Sopenharmony_ci/* ========================================================================= */ 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci/* mpc52xx_common.c */ 2728c2ecf20Sopenharmony_ciextern void mpc5200_setup_xlb_arbiter(void); 2738c2ecf20Sopenharmony_ciextern void mpc52xx_declare_of_platform_devices(void); 2748c2ecf20Sopenharmony_ciextern int mpc5200_psc_ac97_gpio_reset(int psc_number); 2758c2ecf20Sopenharmony_ciextern void mpc52xx_map_common_devices(void); 2768c2ecf20Sopenharmony_ciextern int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv); 2778c2ecf20Sopenharmony_ciextern unsigned int mpc52xx_get_xtal_freq(struct device_node *node); 2788c2ecf20Sopenharmony_ciextern void __noreturn mpc52xx_restart(char *cmd); 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci/* mpc52xx_gpt.c */ 2818c2ecf20Sopenharmony_cistruct mpc52xx_gpt_priv; 2828c2ecf20Sopenharmony_ciextern struct mpc52xx_gpt_priv *mpc52xx_gpt_from_irq(int irq); 2838c2ecf20Sopenharmony_ciextern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 period, 2848c2ecf20Sopenharmony_ci int continuous); 2858c2ecf20Sopenharmony_ciextern u64 mpc52xx_gpt_timer_period(struct mpc52xx_gpt_priv *gpt); 2868c2ecf20Sopenharmony_ciextern int mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt); 2878c2ecf20Sopenharmony_ci 2888c2ecf20Sopenharmony_ci/* mpc52xx_lpbfifo.c */ 2898c2ecf20Sopenharmony_ci#define MPC52XX_LPBFIFO_FLAG_READ (0) 2908c2ecf20Sopenharmony_ci#define MPC52XX_LPBFIFO_FLAG_WRITE (1<<0) 2918c2ecf20Sopenharmony_ci#define MPC52XX_LPBFIFO_FLAG_NO_INCREMENT (1<<1) 2928c2ecf20Sopenharmony_ci#define MPC52XX_LPBFIFO_FLAG_NO_DMA (1<<2) 2938c2ecf20Sopenharmony_ci#define MPC52XX_LPBFIFO_FLAG_POLL_DMA (1<<3) 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_cistruct mpc52xx_lpbfifo_request { 2968c2ecf20Sopenharmony_ci struct list_head list; 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci /* localplus bus address */ 2998c2ecf20Sopenharmony_ci unsigned int cs; 3008c2ecf20Sopenharmony_ci size_t offset; 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci /* Memory address */ 3038c2ecf20Sopenharmony_ci void *data; 3048c2ecf20Sopenharmony_ci phys_addr_t data_phys; 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ci /* Details of transfer */ 3078c2ecf20Sopenharmony_ci size_t size; 3088c2ecf20Sopenharmony_ci size_t pos; /* current position of transfer */ 3098c2ecf20Sopenharmony_ci int flags; 3108c2ecf20Sopenharmony_ci int defer_xfer_start; 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci /* What to do when finished */ 3138c2ecf20Sopenharmony_ci void (*callback)(struct mpc52xx_lpbfifo_request *); 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci void *priv; /* Driver private data */ 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci /* statistics */ 3188c2ecf20Sopenharmony_ci int irq_count; 3198c2ecf20Sopenharmony_ci int irq_ticks; 3208c2ecf20Sopenharmony_ci u8 last_byte; 3218c2ecf20Sopenharmony_ci int buffer_not_done_cnt; 3228c2ecf20Sopenharmony_ci}; 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_ciextern int mpc52xx_lpbfifo_submit(struct mpc52xx_lpbfifo_request *req); 3258c2ecf20Sopenharmony_ciextern void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req); 3268c2ecf20Sopenharmony_ciextern void mpc52xx_lpbfifo_poll(void); 3278c2ecf20Sopenharmony_ciextern int mpc52xx_lpbfifo_start_xfer(struct mpc52xx_lpbfifo_request *req); 3288c2ecf20Sopenharmony_ci 3298c2ecf20Sopenharmony_ci/* mpc52xx_pic.c */ 3308c2ecf20Sopenharmony_ciextern void mpc52xx_init_irq(void); 3318c2ecf20Sopenharmony_ciextern unsigned int mpc52xx_get_irq(void); 3328c2ecf20Sopenharmony_ci 3338c2ecf20Sopenharmony_ci/* mpc52xx_pci.c */ 3348c2ecf20Sopenharmony_ci#ifdef CONFIG_PCI 3358c2ecf20Sopenharmony_ciextern int __init mpc52xx_add_bridge(struct device_node *node); 3368c2ecf20Sopenharmony_ciextern void __init mpc52xx_setup_pci(void); 3378c2ecf20Sopenharmony_ci#else 3388c2ecf20Sopenharmony_cistatic inline void mpc52xx_setup_pci(void) { } 3398c2ecf20Sopenharmony_ci#endif 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */ 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci#ifdef CONFIG_PM 3448c2ecf20Sopenharmony_cistruct mpc52xx_suspend { 3458c2ecf20Sopenharmony_ci void (*board_suspend_prepare)(void __iomem *mbar); 3468c2ecf20Sopenharmony_ci void (*board_resume_finish)(void __iomem *mbar); 3478c2ecf20Sopenharmony_ci}; 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ciextern struct mpc52xx_suspend mpc52xx_suspend; 3508c2ecf20Sopenharmony_ciextern int __init mpc52xx_pm_init(void); 3518c2ecf20Sopenharmony_ciextern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level); 3528c2ecf20Sopenharmony_ci 3538c2ecf20Sopenharmony_ci/* lite5200 calls mpc5200 suspend functions, so here they are */ 3548c2ecf20Sopenharmony_ciextern int mpc52xx_pm_prepare(void); 3558c2ecf20Sopenharmony_ciextern int mpc52xx_pm_enter(suspend_state_t); 3568c2ecf20Sopenharmony_ciextern void mpc52xx_pm_finish(void); 3578c2ecf20Sopenharmony_ciextern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */ 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ci#ifdef CONFIG_PPC_LITE5200 3608c2ecf20Sopenharmony_ciint __init lite5200_pm_init(void); 3618c2ecf20Sopenharmony_ci#endif 3628c2ecf20Sopenharmony_ci#endif /* CONFIG_PM */ 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_ci#endif /* __ASM_POWERPC_MPC52xx_H__ */ 3658c2ecf20Sopenharmony_ci 366