3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
5 * SPDX-License-Identifier: GPL-2.0+
12 void initialise_ns87308 (void)
14 #ifdef CONFIG_SYS_NS87308_PS2MOD
18 * Switch floppy drive to PS/2 mode.
20 read_pnp_config(SUPOERIO_CONF1, &data);
22 write_pnp_config(SUPOERIO_CONF1, data);
25 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_KBC1)
26 PNP_SET_DEVICE_BASE(LDEV_KBC1, CONFIG_SYS_NS87308_KBC1_BASE);
27 write_pnp_config(LUN_CONFIG_REG, 0);
28 write_pnp_config(CBASE_HIGH, 0x00);
29 write_pnp_config(CBASE_LOW, 0x64);
32 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_MOUSE)
33 PNP_ACTIVATE_DEVICE(LDEV_MOUSE);
36 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RTC_APC)
37 PNP_SET_DEVICE_BASE(LDEV_RTC_APC, CONFIG_SYS_NS87308_RTC_BASE);
40 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_FDC)
41 PNP_SET_DEVICE_BASE(LDEV_FDC, CONFIG_SYS_NS87308_FDC_BASE);
42 write_pnp_config(LUN_CONFIG_REG, 0x40);
45 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RARP)
46 PNP_SET_DEVICE_BASE(LDEV_PARP, CONFIG_SYS_NS87308_LPT_BASE);
49 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART1)
50 PNP_SET_DEVICE_BASE(LDEV_UART1, CONFIG_SYS_NS87308_UART1_BASE);
53 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART2)
54 PNP_SET_DEVICE_BASE(LDEV_UART2, CONFIG_SYS_NS87308_UART2_BASE);
57 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_GPIO)
58 PNP_SET_DEVICE_BASE(LDEV_GPIO, CONFIG_SYS_NS87308_GPIO_BASE);
61 #if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_POWRMAN)
62 #ifndef CONFIG_SYS_NS87308_PWMAN_BASE
63 PNP_ACTIVATE_DEVICE(LDEV_POWRMAN);
65 PNP_SET_DEVICE_BASE(LDEV_POWRMAN, CONFIG_SYS_NS87308_PWMAN_BASE);
70 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER1, 0x7d);
71 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER2, 0x87);
73 #ifdef CONFIG_SYS_NS87308_PMC1
74 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC1, CONFIG_SYS_NS87308_PMC1);
77 #ifdef CONFIG_SYS_NS87308_PMC2
78 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC2, CONFIG_SYS_NS87308_PMC2);
81 #ifdef CONFIG_SYS_NS87308_PMC3
82 write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC3, CONFIG_SYS_NS87308_PMC3);
87 #ifdef CONFIG_SYS_NS87308_CS0_BASE
88 PNP_PGCS_CSLINE_BASE(0, CONFIG_SYS_NS87308_CS0_BASE);
89 PNP_PGCS_CSLINE_CONF(0, CONFIG_SYS_NS87308_CS0_CONF);
92 #ifdef CONFIG_SYS_NS87308_CS1_BASE
93 PNP_PGCS_CSLINE_BASE(1, CONFIG_SYS_NS87308_CS1_BASE);
94 PNP_PGCS_CSLINE_CONF(1, CONFIG_SYS_NS87308_CS1_CONF);
97 #ifdef CONFIG_SYS_NS87308_CS2_BASE
98 PNP_PGCS_CSLINE_BASE(2, CONFIG_SYS_NS87308_CS2_BASE);
99 PNP_PGCS_CSLINE_CONF(2, CONFIG_SYS_NS87308_CS2_CONF);