| 
					
				 | 
			
			
				@@ -890,3 +890,76 @@ struct platform_device *__init at32_add_device_psif(unsigned int id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return NULL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	pdev = platform_device_alloc("atmel_psif", id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if (!pdev) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return NULL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	switch (id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	case 0: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		pin_mask  = (1 << 8) | (1 << 9); /* CLOCK & DATA */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if (platform_device_add_resources(pdev, atmel_psif0_resource, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					ARRAY_SIZE(atmel_psif0_resource))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			goto err_add_resources; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		atmel_psif0_pclk.dev = &pdev->dev; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		select_peripheral(PIOA, pin_mask, PERIPH_A, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	case 1: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		pin_mask  = (1 << 11) | (1 << 12); /* CLOCK & DATA */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if (platform_device_add_resources(pdev, atmel_psif1_resource, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					ARRAY_SIZE(atmel_psif1_resource))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			goto err_add_resources; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		atmel_psif1_pclk.dev = &pdev->dev; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		select_peripheral(PIOB, pin_mask, PERIPH_A, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	default: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return NULL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	platform_device_add(pdev); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	return pdev; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+err_add_resources: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	platform_device_put(pdev); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	return NULL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/* -------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ *  USART 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * -------------------------------------------------------------------- */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct atmel_uart_data atmel_usart0_data = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_tx	= 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_rx	= 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct resource atmel_usart0_resource[] = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	PBMEM(0xffe00c00), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	IRQ(6), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+DEFINE_DEV_DATA(atmel_usart, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+DEV_CLK(usart, atmel_usart0, pba, 3); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct atmel_uart_data atmel_usart1_data = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_tx	= 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_rx	= 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct resource atmel_usart1_resource[] = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	PBMEM(0xffe01000), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	IRQ(7), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+DEFINE_DEV_DATA(atmel_usart, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+DEV_CLK(usart, atmel_usart1, pba, 4); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct atmel_uart_data atmel_usart2_data = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_tx	= 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_rx	= 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct resource atmel_usart2_resource[] = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	PBMEM(0xffe01400), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	IRQ(8), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+DEFINE_DEV_DATA(atmel_usart, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+DEV_CLK(usart, atmel_usart2, pba, 5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+static struct atmel_uart_data atmel_usart3_data = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	.use_dma_tx	= 1, 
			 |