1 // SPDX-License-Identifier: GPL-2.0+
4 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
11 void initialise_ns87308 (void)
13 #ifdef CONFIG_SYS_NS87308_PS2MOD
17 * Switch floppy drive to PS/2 mode.
19 read_pnp_config(SUPOERIO_CONF1, &data);
21 write_pnp_config(SUPOERIO_CONF1, data);
24 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_KBC1)
25 PNP_SET_DEVICE_BASE(LDEV_KBC1, CONFIG_SYS_NS87308_KBC1_BASE);
26 write_pnp_config(LUN_CONFIG_REG, 0);
27 write_pnp_config(CBASE_HIGH, 0x00);
28 write_pnp_config(CBASE_LOW, 0x64);
31 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_MOUSE)
32 PNP_ACTIVATE_DEVICE(LDEV_MOUSE);
35 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RTC_APC)
36 PNP_SET_DEVICE_BASE(LDEV_RTC_APC, CONFIG_SYS_NS87308_RTC_BASE);
39 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_FDC)
40 PNP_SET_DEVICE_BASE(LDEV_FDC, CONFIG_SYS_NS87308_FDC_BASE);
41 write_pnp_config(LUN_CONFIG_REG, 0x40);
44 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RARP)
45 PNP_SET_DEVICE_BASE(LDEV_PARP, CONFIG_SYS_NS87308_LPT_BASE);
48 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART1)
49 PNP_SET_DEVICE_BASE(LDEV_UART1, CONFIG_SYS_NS87308_UART1_BASE);
52 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART2)
53 PNP_SET_DEVICE_BASE(LDEV_UART2, CONFIG_SYS_NS87308_UART2_BASE);
56 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_GPIO)
57 PNP_SET_DEVICE_BASE(LDEV_GPIO, CONFIG_SYS_NS87308_GPIO_BASE);
60 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_POWRMAN)
61 #ifndef CONFIG_SYS_NS87308_PWMAN_BASE
62 PNP_ACTIVATE_DEVICE(LDEV_POWRMAN);
64 PNP_SET_DEVICE_BASE(LDEV_POWRMAN, CONFIG_SYS_NS87308_PWMAN_BASE);
69 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER1, 0x7d);
70 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER2, 0x87);
72 #ifdef CONFIG_SYS_NS87308_PMC1
73 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC1, CONFIG_SYS_NS87308_PMC1);
76 #ifdef CONFIG_SYS_NS87308_PMC2
77 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC2, CONFIG_SYS_NS87308_PMC2);
80 #ifdef CONFIG_SYS_NS87308_PMC3
81 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC3, CONFIG_SYS_NS87308_PMC3);
86 #ifdef CONFIG_SYS_NS87308_CS0_BASE
87 PNP_PGCS_CSLINE_BASE(0, CONFIG_SYS_NS87308_CS0_BASE);
88 PNP_PGCS_CSLINE_CONF(0, CONFIG_SYS_NS87308_CS0_CONF);
91 #ifdef CONFIG_SYS_NS87308_CS1_BASE
92 PNP_PGCS_CSLINE_BASE(1, CONFIG_SYS_NS87308_CS1_BASE);
93 PNP_PGCS_CSLINE_CONF(1, CONFIG_SYS_NS87308_CS1_CONF);
96 #ifdef CONFIG_SYS_NS87308_CS2_BASE
97 PNP_PGCS_CSLINE_BASE(2, CONFIG_SYS_NS87308_CS2_BASE);
98 PNP_PGCS_CSLINE_CONF(2, CONFIG_SYS_NS87308_CS2_CONF);