1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
27d13d21aSKumar Gala #ifndef __MPC83XX_H__
37d13d21aSKumar Gala #define __MPC83XX_H__
47d13d21aSKumar Gala 
57d13d21aSKumar Gala #include <linux/init.h>
67d13d21aSKumar Gala #include <linux/device.h>
77d52c7b0SKumar Gala #include <asm/pci-bridge.h>
87d13d21aSKumar Gala 
9c1616982SLi Yang /* System Clock Control Register */
10c1616982SLi Yang #define MPC83XX_SCCR_OFFS          0xA08
11e5a94af8SLi Yang #define MPC83XX_SCCR_USB_MASK      0x00f00000
12c1616982SLi Yang #define MPC83XX_SCCR_USB_MPHCM_11  0x00c00000
13c1616982SLi Yang #define MPC83XX_SCCR_USB_MPHCM_01  0x00400000
14c1616982SLi Yang #define MPC83XX_SCCR_USB_MPHCM_10  0x00800000
15c1616982SLi Yang #define MPC83XX_SCCR_USB_DRCM_11   0x00300000
16c1616982SLi Yang #define MPC83XX_SCCR_USB_DRCM_01   0x00100000
17c1616982SLi Yang #define MPC83XX_SCCR_USB_DRCM_10   0x00200000
18b74a7e50SKim Phillips #define MPC8315_SCCR_USB_MASK      0x00c00000
19b74a7e50SKim Phillips #define MPC8315_SCCR_USB_DRCM_11   0x00c00000
201a9ebc0cSAnton Vorontsov #define MPC8315_SCCR_USB_DRCM_01   0x00400000
21e10241d8SLi Yang #define MPC837X_SCCR_USB_DRCM_11   0x00c00000
22c1616982SLi Yang 
23c1616982SLi Yang /* system i/o configuration register low */
24c1616982SLi Yang #define MPC83XX_SICRL_OFFS         0x114
25e5a94af8SLi Yang #define MPC834X_SICRL_USB_MASK     0x60000000
26b7d66c88SPeter Korsgaard #define MPC834X_SICRL_USB0         0x20000000
27b7d66c88SPeter Korsgaard #define MPC834X_SICRL_USB1         0x40000000
28e5a94af8SLi Yang #define MPC831X_SICRL_USB_MASK     0x00000c00
29e5a94af8SLi Yang #define MPC831X_SICRL_USB_ULPI     0x00000800
30c0a20159SAnton Vorontsov #define MPC8315_SICRL_USB_MASK     0x000000fc
31c0a20159SAnton Vorontsov #define MPC8315_SICRL_USB_ULPI     0x00000054
32e10241d8SLi Yang #define MPC837X_SICRL_USB_MASK     0xf0000000
33e10241d8SLi Yang #define MPC837X_SICRL_USB_ULPI     0x50000000
3489f37296SAnton Vorontsov #define MPC837X_SICRL_USBB_MASK    0x30000000
3589f37296SAnton Vorontsov #define MPC837X_SICRL_SD           0x20000000
36c1616982SLi Yang 
37c1616982SLi Yang /* system i/o configuration register high */
38c1616982SLi Yang #define MPC83XX_SICRH_OFFS         0x118
39fd066e85SIlya Yanok #define MPC8308_SICRH_USB_MASK     0x000c0000
40fd066e85SIlya Yanok #define MPC8308_SICRH_USB_ULPI     0x00040000
41e5a94af8SLi Yang #define MPC834X_SICRH_USB_UTMI     0x00020000
42e5a94af8SLi Yang #define MPC831X_SICRH_USB_MASK     0x000000e0
43e5a94af8SLi Yang #define MPC831X_SICRH_USB_ULPI     0x000000a0
44c0a20159SAnton Vorontsov #define MPC8315_SICRH_USB_MASK     0x0000ff00
45c0a20159SAnton Vorontsov #define MPC8315_SICRH_USB_ULPI     0x00000000
4689f37296SAnton Vorontsov #define MPC837X_SICRH_SPI_MASK     0x00000003
4789f37296SAnton Vorontsov #define MPC837X_SICRH_SD           0x00000001
48e5a94af8SLi Yang 
49e5a94af8SLi Yang /* USB Control Register */
50e5a94af8SLi Yang #define FSL_USB2_CONTROL_OFFS      0x500
51e5a94af8SLi Yang #define CONTROL_UTMI_PHY_EN        0x00000200
521a9ebc0cSAnton Vorontsov #define CONTROL_REFSEL_24MHZ       0x00000040
53e5a94af8SLi Yang #define CONTROL_REFSEL_48MHZ       0x00000080
54e5a94af8SLi Yang #define CONTROL_PHY_CLK_SEL_ULPI   0x00000400
55e5a94af8SLi Yang #define CONTROL_OTG_PORT           0x00000020
56e5a94af8SLi Yang 
57e5a94af8SLi Yang /* USB PORTSC Registers */
58e5a94af8SLi Yang #define FSL_USB2_PORTSC1_OFFS      0x184
59e5a94af8SLi Yang #define FSL_USB2_PORTSC2_OFFS      0x188
60e5a94af8SLi Yang #define PORTSCX_PTW_16BIT          0x10000000
61e5a94af8SLi Yang #define PORTSCX_PTS_UTMI           0x00000000
62e5a94af8SLi Yang #define PORTSCX_PTS_ULPI           0x80000000
63c1616982SLi Yang 
647d13d21aSKumar Gala /*
657d13d21aSKumar Gala  * Declaration for the various functions exported by the
667d13d21aSKumar Gala  * mpc83xx_* files. Mostly for use by mpc83xx_setup
677d13d21aSKumar Gala  */
687d13d21aSKumar Gala 
6995ec77c0SDaniel Axtens extern void __noreturn mpc83xx_restart(char *cmd);
7030f59336SKumar Gala extern long mpc83xx_time_init(void);
71*f4a88b0eSNick Child int __init mpc837x_usb_cfg(void);
72*f4a88b0eSNick Child int __init mpc834x_usb_cfg(void);
73*f4a88b0eSNick Child int __init mpc831x_usb_cfg(void);
74d4fb5ebdSDmitry Eremin-Solenikov extern void mpc83xx_ipic_init_IRQ(void);
75d4fb5ebdSDmitry Eremin-Solenikov 
76bede480dSDmitry Eremin-Solenikov #ifdef CONFIG_PCI
77bede480dSDmitry Eremin-Solenikov extern void mpc83xx_setup_pci(void);
78bede480dSDmitry Eremin-Solenikov #else
795c47c44fSMichael Ellerman #define mpc83xx_setup_pci	NULL
80bede480dSDmitry Eremin-Solenikov #endif
81bede480dSDmitry Eremin-Solenikov 
827669d58cSDmitry Eremin-Solenikov extern int mpc83xx_declare_of_platform_devices(void);
83fff69fd0SKevin Hao extern void mpc83xx_setup_arch(void);
847d13d21aSKumar Gala 
857d13d21aSKumar Gala #endif				/* __MPC83XX_H__ */
86