18 #include <linux/slab.h>
24 #include <asm/machdep.h>
37 #define BCSR7_SCC2_ENABLE 0x10
39 #define BCSR8_PHY1_ENABLE 0x80
40 #define BCSR8_PHY1_POWER 0x40
41 #define BCSR8_PHY2_ENABLE 0x20
42 #define BCSR8_PHY2_POWER 0x10
43 #define BCSR8_MDIO_READ 0x04
44 #define BCSR8_MDIO_CLOCK 0x02
45 #define BCSR8_MDIO_DATA 0x01
47 #define BCSR9_USB_ENABLE 0x80
48 #define BCSR9_USB_POWER 0x40
49 #define BCSR9_USB_HOST 0x20
50 #define BCSR9_USB_FULL_SPEED_TARGET 0x10
52 static void __init ep8248e_pic_init(
void)
72 in_8(&ep8248e_bcsr[8]);
75 static void ep8248e_set_mdio_dir(
struct mdiobb_ctrl *ctrl,
int output)
83 in_8(&ep8248e_bcsr[8]);
94 in_8(&ep8248e_bcsr[8]);
97 static int ep8248e_get_mdio_data(
struct mdiobb_ctrl *ctrl)
102 static const struct mdiobb_ops ep8248e_mdio_ops = {
103 .set_mdc = ep8248e_set_mdc,
104 .set_mdio_dir = ep8248e_set_mdio_dir,
105 .set_mdio_data = ep8248e_set_mdio_data,
106 .get_mdio_data = ep8248e_get_mdio_data,
111 .ops = &ep8248e_mdio_ops,
123 if (node != ep8248e_bcsr_node)
140 bus->
name =
"ep8248e-mdio-bitbang";
162 static const struct of_device_id ep8248e_mdio_match[] = {
164 .compatible =
"fsl,ep8248e-mdio-bitbang",
171 .name =
"ep8248e-mdio-bitbang",
173 .of_match_table = ep8248e_mdio_match,
175 .probe = ep8248e_mdio_probe,
176 .remove = ep8248e_mdio_remove,
245 static void __init init_ioports(
void)
249 for (i = 0; i <
ARRAY_SIZE(ep8248e_pins); i++) {
264 static void __init ep8248e_setup_arch(
void)
267 ppc_md.progress(
"ep8248e_setup_arch()", 0);
274 clrbits32(&
cpm2_immr->im_siu_conf.siu_82xx.sc_bcr, MPC82XX_BCR_PLDP);
278 if (!ep8248e_bcsr_node) {
283 ep8248e_bcsr =
of_iomap(ep8248e_bcsr_node, 0);
286 of_node_put(ep8248e_bcsr_node);
287 ep8248e_bcsr_node =
NULL;
298 ppc_md.progress(
"ep8248e_setup_arch(), finish", 0);
302 { .compatible =
"simple-bus", },
303 { .compatible =
"fsl,ep8248e-bcsr", },
307 static int __init declare_of_platform_devices(
void)
309 of_platform_bus_probe(
NULL, of_bus_ids,
NULL);
319 static int __init ep8248e_probe(
void)
321 unsigned long root = of_get_flat_dt_root();
322 return of_flat_dt_is_compatible(root,
"fsl,ep8248e");
327 .name =
"Embedded Planet EP8248E",
328 .probe = ep8248e_probe,
329 .setup_arch = ep8248e_setup_arch,
330 .init_IRQ = ep8248e_pic_init,