10 #include <linux/device.h>
12 #include <linux/kernel.h>
14 #include <linux/resource.h>
17 #include <linux/i2c.h>
31 value = nlm_read_reg(uartbase, offset);
55 nlm_write_reg(uartbase, offset, value);
62 .iotype = UPIO_MEM32, \
63 .flags = (UPF_SKIP_TEST | \
64 UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF),\
65 .uartclk = PIC_CLKS_PER_SEC, \
66 .type = PORT_16550A, \
67 .serial_in = nlm_xlr_uart_in, \
68 .serial_out = nlm_xlr_uart_out, \
81 .platform_data = xlr_uart_data,
85 static int __init nlm_uart_init(
void)
87 unsigned long uartbase;
104 static u64 xls_usb_dmamask = ~(
u32)0;
105 #define USB_PLATFORM_DEV(n, i, irq) \
109 .num_resources = 2, \
111 .dma_mask = &xls_usb_dmamask, \
112 .coherent_dma_mask = 0xffffffff, \
114 .resource = (struct resource[]) { \
116 .flags = IORESOURCE_MEM, \
121 .flags = IORESOURCE_IRQ, \
134 &xls_usb_ehci_device,
135 &xls_usb_ohci_device_0,
136 &xls_usb_ohci_device_1,
139 int xls_platform_usb_init(
void)
142 unsigned long memres;
145 if (!nlm_chip_is_xls())
152 nlm_write_reg(usb_mmio, 49, 0x10000000);
154 nlm_write_reg(usb_mmio, 50, 0x1f000000);
157 nlm_write_reg(usb_mmio, 1, 0x07000500);
159 val = nlm_read_reg(gpio_mmio, 21);
160 if (((val >> 22) & 0x01) == 0) {
161 pr_info(
"Detected USB Device mode - Not supported!\n");
162 nlm_write_reg(usb_mmio, 0, 0x01000000);
166 pr_info(
"Detected USB Host mode - Adding XLS USB devices.\n");
168 nlm_write_reg(usb_mmio, 0, 0x02000000);
172 memres =
CPHYSADDR((
unsigned long)usb_mmio);
173 xls_usb_ehci_device.
resource[0].start = memres;
174 xls_usb_ehci_device.
resource[0].end = memres + 0x400 - 1;
177 xls_usb_ohci_device_0.
resource[0].start = memres;
178 xls_usb_ohci_device_0.
resource[0].end = memres + 0x400 - 1;
181 xls_usb_ohci_device_1.
resource[0].start = memres;
182 xls_usb_ohci_device_1.
resource[0].end = memres + 0x400 - 1;
204 static struct resource i2c_resources[] = {
213 .
name =
"xlr-i2cbus",
216 .resource = i2c_resources,
219 static int __init nlm_i2c_init(
void)
234 pr_err(
"nlm-i2c: cannot register board I2C devices\n");