summaryrefslogtreecommitdiffstats
path: root/kernel/arch/arm/mach-iop33x/uart.c
blob: bbf54d794ce81edf74ce922e37285780d3139850 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 * arch/arm/mach-iop33x/uart.c
 *
 * Author: Dave Jiang (dave.jiang@intel.com)
 * Copyright (C) 2004 Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/mm.h>
#include <linux/init.h>
#include <linux/major.h>
#include <linux/fs.h>
#include <linux/platform_device.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/mach/map.h>
#include <asm/setup.h>
#include <asm/memory.h>
#include <mach/hardware.h>
#include <asm/hardware/iop3xx.h>
#include <asm/mach/arch.h>

#define IOP33X_UART_XTAL 33334000

static struct plat_serial8250_port iop33x_uart0_data[] = {
	{
		.membase	= (char *)IOP33X_UART0_VIRT,
		.mapbase	= IOP33X_UART0_PHYS,
		.irq		= IRQ_IOP33X_UART0,
		.uartclk	= IOP33X_UART_XTAL,
		.regshift	= 2,
		.iotype		= UPIO_MEM,
		.flags		= UPF_SKIP_TEST,
	},
	{ },
};

static struct resource iop33x_uart0_resources[] = {
	[0] = {
		.start	= IOP33X_UART0_PHYS,
		.end	= IOP33X_UART0_PHYS + 0x3f,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= IRQ_IOP33X_UART0,
		.end	= IRQ_IOP33X_UART0,
		.flags	= IORESOURCE_IRQ,
	},
};

struct platform_device iop33x_uart0_device = {
	.name		= "serial8250",
	.id		= PLAT8250_DEV_PLATFORM,
	.dev		= {
		.platform_data		= iop33x_uart0_data,
	},
	.num_resources	= 2,
	.resource	= iop33x_uart0_resources,
};


static struct resource iop33x_uart1_resources[] = {
	[0] = {
		.start	= IOP33X_UART1_PHYS,
		.end	= IOP33X_UART1_PHYS + 0x3f,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= IRQ_IOP33X_UART1,
		.end	= IRQ_IOP33X_UART1,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct plat_serial8250_port iop33x_uart1_data[] = {
	{
		.membase	= (char *)IOP33X_UART1_VIRT,
		.mapbase	= IOP33X_UART1_PHYS,
		.irq		= IRQ_IOP33X_UART1,
		.uartclk	= IOP33X_UART_XTAL,
		.regshift	= 2,
		.iotype		= UPIO_MEM,
		.flags		= UPF_SKIP_TEST,
	},
	{ },
};

struct platform_device iop33x_uart1_device = {
	.name		= "serial8250",
	.id		= PLAT8250_DEV_PLATFORM1,
	.dev		= {
		.platform_data		= iop33x_uart1_data,
	},
	.num_resources	= 2,
	.resource	= iop33x_uart1_resources,
};
pan class="s1">'Check the VNF status') while retry > 0: rq = requests.get(vnf_status_url, timeout=90) response = rq.json() vnf_alive = response['vnf_alive'] msg = response['msg'] self.logger.info(msg) if vnf_alive: break self.logger.info('check again in one and half a minute...') retry = retry - 1 time.sleep(90) if not vnf_alive: raise Exception('VNF failed to start: {0}'.format(msg)) ellis_config_url = ('http://{0}:5000/api/v1/model/ellis/configure' .format(vnfm_ip)) rq = requests.get(ellis_config_url, timeout=90) if rq.json() and not rq.json()['ellis_ok']: self.logger.error(rq.json()['data']) raise Exception('Failed to configure Ellis') self.logger.info('Get Clearwater deployment detail') vnf_info_url = ('http://{0}:5000/api/v1/model/output' .format(vnfm_ip)) rq = requests.get(vnf_info_url, timeout=90) data = rq.json()['data'] self.logger.info(data) bono_ip = data['bono_ip'] ellis_ip = data['ellis_ip'] dns_ip = data['dns_ip'] result = self.config_ellis(ellis_ip, 'signup', True) self.logger.debug('Ellis Result: %s', result) self.dump_info(self.ellis_file, result) if dns_ip: vims_test_result = self.run_clearwater_live_test( dns_ip, 'clearwater.local', bono_ip, ellis_ip, 'signup') if vims_test_result != '': self.dump_info(self.live_test_file, vims_test_result) return {'status': 'PASS', 'result': vims_test_result} else: return {'status': 'FAIL', 'result': ''} def main(self, **kwargs): self.logger.info("Start to run Opera vIMS VNF onboarding test") self.execute() self.logger.info("Opera vIMS VNF onboarding test finished") if self.result is "PASS": return self.EX_OK else: return self.EX_RUN_ERROR def run(self): kwargs = {} return self.main(**kwargs)