static int __init l4vpci_init(void) { int err; vbus = l4re_env_get_cap("vbus"); if (l4_is_invalid_cap(vbus)) return -ENOENT; err = L4XV_FN_i(l4vbus_get_device_by_hid(vbus, 0, &root_bridge, "PNP0A03", 0, 0)); if (err < 0) { printk(KERN_INFO "l4vPCI: no root bridge found, no PCI\n"); return err; } printk(KERN_INFO "l4vPCI: L4 root bridge is device %lx\n", root_bridge); #ifdef CONFIG_X86 return l4vpci_x86_init(); #endif #ifdef CONFIG_ARM pci_common_init(&l4vpci_pci); return 0; #endif }
static int clcd_init_overo(void) { vbus = l4re_get_env_cap("vbus"); if (l4_is_invalid_cap(vbus)) { printf("[LCD] Error: Could not query <vbus> capability\n"); return -1; } if (l4vbus_get_device_by_hid(vbus, 0, &i2c_handle, "i2c", 0, 0)) { printf("[LCD] Error: Could not find <i2c> vbus device\n"); return -1; } if (l4vbus_get_device_by_hid(vbus, 0, &gpio_handle, "gpio", 0, 0)) { printf("[LCD] Error: Could not find <gpio> vbus device\n"); return -L4_ENODEV; } return 0; }
static int __init l4vpci_init(void) { struct pci_dev *dev = NULL; #ifdef CONFIG_ARM struct pci_sys_data *sd; #else struct pci_sysdata *sd; #endif int err; L4XV_V(f); vbus = l4re_get_env_cap("vbus"); if (l4_is_invalid_cap(vbus)) return -ENOENT; L4XV_L(f); err = l4vbus_get_device_by_hid(vbus, 0, &root_bridge, "PNP0A03", 0, 0); if (err < 0) { printk(KERN_INFO "PCI: no root bridge found, no PCI\n"); L4XV_U(f); return err; } L4XV_U(f); printk(KERN_INFO "PCI: L4 root bridge is device %lx\n", root_bridge); sd = kzalloc(sizeof(*sd), GFP_KERNEL); if (!sd) return -ENOMEM; pci_scan_bus(0, &l4vpci_ops, sd); printk(KERN_INFO "PCI: Using L4-IO for IRQ routing\n"); for_each_pci_dev(dev) l4vpci_irq_enable(dev); #ifdef CONFIG_X86 pcibios_resource_survey(); #endif return 0; }
static int kp_init(void) { vbus = l4re_get_env_cap("vbus"); if (l4_is_invalid_cap(vbus)) { printf("[KEYP] Failed to query vbus\n"); return -1; } if (l4vbus_get_device_by_hid(vbus, 0, &i2c_handle, "i2c", 0, 0)) { printf("[KEYP] ##### Cannot find I2C\n"); } return init_keypad(); }