diff options
Diffstat (limited to 'arch/xtensa/platforms/xtfpga')
| -rw-r--r-- | arch/xtensa/platforms/xtfpga/include/platform/hardware.h | 6 | ||||
| -rw-r--r-- | arch/xtensa/platforms/xtfpga/setup.c | 21 | 
2 files changed, 12 insertions, 15 deletions
diff --git a/arch/xtensa/platforms/xtfpga/include/platform/hardware.h b/arch/xtensa/platforms/xtfpga/include/platform/hardware.h index 4416773cbde..aeb316b7ff8 100644 --- a/arch/xtensa/platforms/xtfpga/include/platform/hardware.h +++ b/arch/xtensa/platforms/xtfpga/include/platform/hardware.h @@ -15,10 +15,6 @@  #ifndef __XTENSA_XTAVNET_HARDWARE_H  #define __XTENSA_XTAVNET_HARDWARE_H -/* By default NO_IRQ is defined to 0 in Linux, but we use the -   interrupt 0 for UART... */ -#define NO_IRQ                 -1 -  /* Memory configuration. */  #define PLATFORM_DEFAULT_MEM_START 0x00000000 @@ -30,7 +26,7 @@  /* Default assignment of LX60 devices to external interrupts. */ -#ifdef CONFIG_ARCH_HAS_SMP +#ifdef CONFIG_XTENSA_MX  #define DUART16552_INTNUM	XCHAL_EXTINT3_NUM  #define OETH_IRQ		XCHAL_EXTINT4_NUM  #else diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c index 74bb74fa3f8..57fd08b36f5 100644 --- a/arch/xtensa/platforms/xtfpga/setup.c +++ b/arch/xtensa/platforms/xtfpga/setup.c @@ -135,11 +135,11 @@ static void __init update_local_mac(struct device_node *node)  static int __init machine_setup(void)  { -	struct device_node *serial; +	struct device_node *clock;  	struct device_node *eth = NULL; -	for_each_compatible_node(serial, NULL, "ns16550a") -		update_clock_frequency(serial); +	for_each_node_by_name(clock, "main-oscillator") +		update_clock_frequency(clock);  	if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))  		update_local_mac(eth); @@ -168,7 +168,7 @@ void __init platform_calibrate_ccount(void)  	long clk_freq = 0;  #ifdef CONFIG_OF  	struct device_node *cpu = -		of_find_compatible_node(NULL, NULL, "xtensa,cpu"); +		of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");  	if (cpu) {  		u32 freq;  		update_clock_frequency(cpu); @@ -194,7 +194,7 @@ void __init platform_calibrate_ccount(void)   *  Ethernet -- OpenCores Ethernet MAC (ethoc driver)   */ -static struct resource ethoc_res[] __initdata = { +static struct resource ethoc_res[] = {  	[0] = { /* register space */  		.start = OETH_REGS_PADDR,  		.end   = OETH_REGS_PADDR + OETH_REGS_SIZE - 1, @@ -212,7 +212,7 @@ static struct resource ethoc_res[] __initdata = {  	},  }; -static struct ethoc_platform_data ethoc_pdata __initdata = { +static struct ethoc_platform_data ethoc_pdata = {  	/*  	 * The MAC address for these boards is 00:50:c2:13:6f:xx.  	 * The last byte (here as zero) is read from the DIP switches on the @@ -222,7 +222,7 @@ static struct ethoc_platform_data ethoc_pdata __initdata = {  	.phy_id = -1,  }; -static struct platform_device ethoc_device __initdata = { +static struct platform_device ethoc_device = {  	.name = "ethoc",  	.id = -1,  	.num_resources = ARRAY_SIZE(ethoc_res), @@ -236,13 +236,13 @@ static struct platform_device ethoc_device __initdata = {   *  UART   */ -static struct resource serial_resource __initdata = { +static struct resource serial_resource = {  	.start	= DUART16552_PADDR,  	.end	= DUART16552_PADDR + 0x1f,  	.flags	= IORESOURCE_MEM,  }; -static struct plat_serial8250_port serial_platform_data[] __initdata = { +static struct plat_serial8250_port serial_platform_data[] = {  	[0] = {  		.mapbase	= DUART16552_PADDR,  		.irq		= DUART16552_INTNUM, @@ -255,7 +255,7 @@ static struct plat_serial8250_port serial_platform_data[] __initdata = {  	{ },  }; -static struct platform_device xtavnet_uart __initdata = { +static struct platform_device xtavnet_uart = {  	.name		= "serial8250",  	.id		= PLAT8250_DEV_PLATFORM,  	.dev		= { @@ -290,6 +290,7 @@ static int __init xtavnet_init(void)  	 * knows whether they set it correctly on the DIP switches.  	 */  	pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr); +	ethoc_pdata.eth_clkfreq = *(long *)XTFPGA_CLKFRQ_VADDR;  	return 0;  }  | 
