<commit_before>/*
 * arch/arm/mach-ixp4xx/nslu2-setup.c
 *
 * NSLU2 board-setup
 *
 * based ixdp425-setup.c:
 *      Copyright (C) 2003-2004 MontaVista Software, Inc.
 *
 * Author: <NAME> <mrakes at mac.com>
 * Maintainers: http://www.nslu2-linux.org/
 *
 * Fixed missing init_time in MACHINE_START kas11 10/22/04
 * Changed to conform to new style __init ixdp425 kas11 10/22/04 
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>

#include <asm/types.h>
#include <asm/setup.h>
#include <asm/memory.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>

void __init nslu2_map_io(void) 
{
	ixp4xx_map_io();
}

static struct flash_platform_data nslu2_flash_data = {
	.map_name	= "cfi_probe",
	.width		= 2,
};

static struct resource nslu2_flash_resource = {
	.start		= NSLU2_FLASH_BASE,
	.end		= NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE,
	.flags		= IORESOURCE_MEM,
};

static struct platform_device nslu2_flash = {
	.name		= "IXP4XX-Flash",
	.id		= 0,
	.dev		= {
		.platform_data = &nslu2_flash_data,
	},
	.num_resources	= 1,
	.resource	= &nslu2_flash_resource,
};

static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
	.sda_pin	= NSLU2_SDA_PIN,
	.scl_pin	= NSLU2_SCL_PIN,
};

static struct platform_device nslu2_i2c_controller = {
	.name		= "IXP4XX-I2C",
	.id		= 0,
	.dev		= {
		.platform_data = &nslu2_i2c_gpio_pins,
	},
	.num_resources	= 0
};

static struct resource nslu2_uart_resources[] = {
	{
		.start		= IXP4XX_UART1_BASE_PHYS,
		.end		= IXP4XX_UART1_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM
	},
	{
	},
#if 0 
	, {
		.start		= IXP4XX_UART2_BASE_PHYS,
		.end		= IXP4XX_UART2_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM
	}
#endif
};

static struct plat_serial8250_port nslu2_uart_data[] = {
	{
		.mapbase	= IXP4XX_UART1_BASE_PHYS,
		.membase	= (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
		.irq		= IRQ_IXP4XX_UART1,
		.flags		= UPF_BOOT_AUTOCONF,
		.iotype		= UPIO_MEM,
		.regshift	= 2,
		.uartclk	= IXP4XX_UART_XTAL,
	},
	{
	},

#if 0
	, {
		.mapbase	= IXP4XX_UART2_BASE_PHYS,
		.membase	= (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
		.irq		= IRQ_IXP4XX_UART1,
		.flags		= UPF_BOOT_AUTOCONF,
		.iotype		= UPIO_MEM,
		.regshift	= 2,
		.uartclk	= IXP4XX_UART_XTAL,
	}
#endif
};

static struct platform_device nslu2_uart = {
	.name			= "serial8250",<commit_msg>Add 2nd serial port support.  It is a RX only port, but useful for things like GPSs<commit_after>/*
 * arch/arm/mach-ixp4xx/nslu2-setup.c
 *
 * NSLU2 board-setup
 *
 * based ixdp425-setup.c:
 *      Copyright (C) 2003-2004 MontaVista Software, Inc.
 *
 * Author: <NAME> <mrakes at mac.<EMAIL>>
 * Maintainers: http://www.nslu2-linux.org/
 *
 * Fixed missing init_time in MACHINE_START kas11 10/22/04
 * Changed to conform to new style __init ixdp425 kas11 10/22/04 
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>

#include <asm/types.h>
#include <asm/setup.h>
#include <asm/memory.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>

void __init nslu2_map_io(void) 
{
	ixp4xx_map_io();
}

static struct flash_platform_data nslu2_flash_data = {
	.map_name	= "cfi_probe",
	.width		= 2,
};

static struct resource nslu2_flash_resource = {
	.start		= NSLU2_FLASH_BASE,
	.end		= NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE,
	.flags		= IORESOURCE_MEM,
};

static struct platform_device nslu2_flash = {
	.name		= "IXP4XX-Flash",
	.id		= 0,
	.dev		= {
		.platform_data = &nslu2_flash_data,
	},
	.num_resources	= 1,
	.resource	= &nslu2_flash_resource,
};

static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
	.sda_pin	= NSLU2_SDA_PIN,
	.scl_pin	= NSLU2_SCL_PIN,
};

static struct platform_device nslu2_i2c_controller = {
	.name		= "IXP4XX-I2C",
	.id		= 0,
	.dev		= {
		.platform_data = &nslu2_i2c_gpio_pins,
	},
	.num_resources	= 0
};

static struct resource nslu2_uart_resources[] = {
	{
		.start		= IXP4XX_UART1_BASE_PHYS,
		.end		= IXP4XX_UART1_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM
	},
	{
		.start		= IXP4XX_UART2_BASE_PHYS,
		.end		= IXP4XX_UART2_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM
	}
};

static struct plat_serial8250_port nslu2_uart_data[] = {
	{
		.mapbase	= IXP4XX_UART1_BASE_PHYS,
		.membase	= (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
		.irq		= IRQ_IXP4XX_UART1,
		.flags		= UPF_BOOT_AUTOCONF,
		.iotype		= UPIO_MEM,
		.regshift	= 2,
		.uartclk	= IXP4XX_UART_XTAL,
	},
	{
		.mapbase	= IXP4XX_UART2_BASE_PHYS,
		.membase	= (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
		.irq		= IRQ_IXP4XX_UART2,
		.flags		= UPF_BOOT_AUTOCONF,
		.iotype		= UPIO_MEM,
		.regshift	= 2,
		.uartclk	= IXP4XX_UART_XTAL,
	}
};

static struct platform_device nslu2_uart = {
	.name			= "serial8250",
{'fraction_non_alphanumeric': 0.13177041228779304, 'fraction_numerical': 0.043047696038803554, 'mean_word_length': 3.7816425120772945, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4222590', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2359, 'n_words': 387}