18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __MPC83XX_H__ 38c2ecf20Sopenharmony_ci#define __MPC83XX_H__ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <linux/init.h> 68c2ecf20Sopenharmony_ci#include <linux/device.h> 78c2ecf20Sopenharmony_ci#include <asm/pci-bridge.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci/* System Clock Control Register */ 108c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_OFFS 0xA08 118c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_MASK 0x00f00000 128c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_MPHCM_11 0x00c00000 138c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_MPHCM_01 0x00400000 148c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_MPHCM_10 0x00800000 158c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_DRCM_11 0x00300000 168c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_DRCM_01 0x00100000 178c2ecf20Sopenharmony_ci#define MPC83XX_SCCR_USB_DRCM_10 0x00200000 188c2ecf20Sopenharmony_ci#define MPC8315_SCCR_USB_MASK 0x00c00000 198c2ecf20Sopenharmony_ci#define MPC8315_SCCR_USB_DRCM_11 0x00c00000 208c2ecf20Sopenharmony_ci#define MPC8315_SCCR_USB_DRCM_01 0x00400000 218c2ecf20Sopenharmony_ci#define MPC837X_SCCR_USB_DRCM_11 0x00c00000 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* system i/o configuration register low */ 248c2ecf20Sopenharmony_ci#define MPC83XX_SICRL_OFFS 0x114 258c2ecf20Sopenharmony_ci#define MPC834X_SICRL_USB_MASK 0x60000000 268c2ecf20Sopenharmony_ci#define MPC834X_SICRL_USB0 0x20000000 278c2ecf20Sopenharmony_ci#define MPC834X_SICRL_USB1 0x40000000 288c2ecf20Sopenharmony_ci#define MPC831X_SICRL_USB_MASK 0x00000c00 298c2ecf20Sopenharmony_ci#define MPC831X_SICRL_USB_ULPI 0x00000800 308c2ecf20Sopenharmony_ci#define MPC8315_SICRL_USB_MASK 0x000000fc 318c2ecf20Sopenharmony_ci#define MPC8315_SICRL_USB_ULPI 0x00000054 328c2ecf20Sopenharmony_ci#define MPC837X_SICRL_USB_MASK 0xf0000000 338c2ecf20Sopenharmony_ci#define MPC837X_SICRL_USB_ULPI 0x50000000 348c2ecf20Sopenharmony_ci#define MPC837X_SICRL_USBB_MASK 0x30000000 358c2ecf20Sopenharmony_ci#define MPC837X_SICRL_SD 0x20000000 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* system i/o configuration register high */ 388c2ecf20Sopenharmony_ci#define MPC83XX_SICRH_OFFS 0x118 398c2ecf20Sopenharmony_ci#define MPC8308_SICRH_USB_MASK 0x000c0000 408c2ecf20Sopenharmony_ci#define MPC8308_SICRH_USB_ULPI 0x00040000 418c2ecf20Sopenharmony_ci#define MPC834X_SICRH_USB_UTMI 0x00020000 428c2ecf20Sopenharmony_ci#define MPC831X_SICRH_USB_MASK 0x000000e0 438c2ecf20Sopenharmony_ci#define MPC831X_SICRH_USB_ULPI 0x000000a0 448c2ecf20Sopenharmony_ci#define MPC8315_SICRH_USB_MASK 0x0000ff00 458c2ecf20Sopenharmony_ci#define MPC8315_SICRH_USB_ULPI 0x00000000 468c2ecf20Sopenharmony_ci#define MPC837X_SICRH_SPI_MASK 0x00000003 478c2ecf20Sopenharmony_ci#define MPC837X_SICRH_SD 0x00000001 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci/* USB Control Register */ 508c2ecf20Sopenharmony_ci#define FSL_USB2_CONTROL_OFFS 0x500 518c2ecf20Sopenharmony_ci#define CONTROL_UTMI_PHY_EN 0x00000200 528c2ecf20Sopenharmony_ci#define CONTROL_REFSEL_24MHZ 0x00000040 538c2ecf20Sopenharmony_ci#define CONTROL_REFSEL_48MHZ 0x00000080 548c2ecf20Sopenharmony_ci#define CONTROL_PHY_CLK_SEL_ULPI 0x00000400 558c2ecf20Sopenharmony_ci#define CONTROL_OTG_PORT 0x00000020 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci/* USB PORTSC Registers */ 588c2ecf20Sopenharmony_ci#define FSL_USB2_PORTSC1_OFFS 0x184 598c2ecf20Sopenharmony_ci#define FSL_USB2_PORTSC2_OFFS 0x188 608c2ecf20Sopenharmony_ci#define PORTSCX_PTW_16BIT 0x10000000 618c2ecf20Sopenharmony_ci#define PORTSCX_PTS_UTMI 0x00000000 628c2ecf20Sopenharmony_ci#define PORTSCX_PTS_ULPI 0x80000000 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci/* 658c2ecf20Sopenharmony_ci * Declaration for the various functions exported by the 668c2ecf20Sopenharmony_ci * mpc83xx_* files. Mostly for use by mpc83xx_setup 678c2ecf20Sopenharmony_ci */ 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciextern void __noreturn mpc83xx_restart(char *cmd); 708c2ecf20Sopenharmony_ciextern long mpc83xx_time_init(void); 718c2ecf20Sopenharmony_ciextern int mpc837x_usb_cfg(void); 728c2ecf20Sopenharmony_ciextern int mpc834x_usb_cfg(void); 738c2ecf20Sopenharmony_ciextern int mpc831x_usb_cfg(void); 748c2ecf20Sopenharmony_ciextern void mpc83xx_ipic_init_IRQ(void); 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#ifdef CONFIG_PCI 778c2ecf20Sopenharmony_ciextern void mpc83xx_setup_pci(void); 788c2ecf20Sopenharmony_ci#else 798c2ecf20Sopenharmony_ci#define mpc83xx_setup_pci() do {} while (0) 808c2ecf20Sopenharmony_ci#endif 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ciextern int mpc83xx_declare_of_platform_devices(void); 838c2ecf20Sopenharmony_ciextern void mpc83xx_setup_arch(void); 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#endif /* __MPC83XX_H__ */ 86