1*e3b3d0f5SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 29bef3d41SPaul Gortmaker /* 39bef3d41SPaul Gortmaker * Copyright (C) 2005 Russell King. 49bef3d41SPaul Gortmaker * Data taken from include/asm-i386/serial.h 59bef3d41SPaul Gortmaker * 69bef3d41SPaul Gortmaker * This program is free software; you can redistribute it and/or modify 79bef3d41SPaul Gortmaker * it under the terms of the GNU General Public License version 2 as 89bef3d41SPaul Gortmaker * published by the Free Software Foundation. 99bef3d41SPaul Gortmaker */ 109bef3d41SPaul Gortmaker #include <linux/module.h> 119bef3d41SPaul Gortmaker #include <linux/init.h> 129bef3d41SPaul Gortmaker #include <linux/serial_8250.h> 139bef3d41SPaul Gortmaker 149bef3d41SPaul Gortmaker #define HUB6(card, port) \ 159bef3d41SPaul Gortmaker { \ 169bef3d41SPaul Gortmaker .iobase = 0x302, \ 179bef3d41SPaul Gortmaker .irq = 3, \ 189bef3d41SPaul Gortmaker .uartclk = 1843200, \ 199bef3d41SPaul Gortmaker .iotype = UPIO_HUB6, \ 209bef3d41SPaul Gortmaker .flags = UPF_BOOT_AUTOCONF, \ 219bef3d41SPaul Gortmaker .hub6 = (card) << 6 | (port) << 3 | 1, \ 229bef3d41SPaul Gortmaker } 239bef3d41SPaul Gortmaker 249bef3d41SPaul Gortmaker static struct plat_serial8250_port hub6_data[] = { 259bef3d41SPaul Gortmaker HUB6(0, 0), 269bef3d41SPaul Gortmaker HUB6(0, 1), 279bef3d41SPaul Gortmaker HUB6(0, 2), 289bef3d41SPaul Gortmaker HUB6(0, 3), 299bef3d41SPaul Gortmaker HUB6(0, 4), 309bef3d41SPaul Gortmaker HUB6(0, 5), 319bef3d41SPaul Gortmaker HUB6(1, 0), 329bef3d41SPaul Gortmaker HUB6(1, 1), 339bef3d41SPaul Gortmaker HUB6(1, 2), 349bef3d41SPaul Gortmaker HUB6(1, 3), 359bef3d41SPaul Gortmaker HUB6(1, 4), 369bef3d41SPaul Gortmaker HUB6(1, 5), 379bef3d41SPaul Gortmaker { }, 389bef3d41SPaul Gortmaker }; 399bef3d41SPaul Gortmaker 409bef3d41SPaul Gortmaker static struct platform_device hub6_device = { 419bef3d41SPaul Gortmaker .name = "serial8250", 429bef3d41SPaul Gortmaker .id = PLAT8250_DEV_HUB6, 439bef3d41SPaul Gortmaker .dev = { 449bef3d41SPaul Gortmaker .platform_data = hub6_data, 459bef3d41SPaul Gortmaker }, 469bef3d41SPaul Gortmaker }; 479bef3d41SPaul Gortmaker 489bef3d41SPaul Gortmaker static int __init hub6_init(void) 499bef3d41SPaul Gortmaker { 509bef3d41SPaul Gortmaker return platform_device_register(&hub6_device); 519bef3d41SPaul Gortmaker } 529bef3d41SPaul Gortmaker 539bef3d41SPaul Gortmaker module_init(hub6_init); 549bef3d41SPaul Gortmaker 559bef3d41SPaul Gortmaker MODULE_AUTHOR("Russell King"); 569bef3d41SPaul Gortmaker MODULE_DESCRIPTION("8250 serial probe module for Hub6 cards"); 579bef3d41SPaul Gortmaker MODULE_LICENSE("GPL"); 58