Linux Audio

Check our new training course

Loading...
v4.6
 
  1/*
  2 * linux/arch/arm/mach-sa1100/shannon.c
  3 */
  4
  5#include <linux/init.h>
  6#include <linux/device.h>
 
  7#include <linux/kernel.h>
  8#include <linux/platform_data/sa11x0-serial.h>
  9#include <linux/tty.h>
 10#include <linux/mtd/mtd.h>
 11#include <linux/mtd/partitions.h>
 
 
 12
 13#include <video/sa1100fb.h>
 14
 15#include <mach/hardware.h>
 16#include <asm/mach-types.h>
 17#include <asm/setup.h>
 18
 19#include <asm/mach/arch.h>
 20#include <asm/mach/flash.h>
 21#include <asm/mach/map.h>
 22#include <linux/platform_data/mfd-mcp-sa11x0.h>
 23#include <mach/shannon.h>
 24#include <mach/irqs.h>
 25
 26#include "generic.h"
 27
 28static struct mtd_partition shannon_partitions[] = {
 29	{
 30		.name		= "BLOB boot loader",
 31		.offset		= 0,
 32		.size		= 0x20000
 33	},
 34	{
 35		.name		= "kernel",
 36		.offset		= MTDPART_OFS_APPEND,
 37		.size		= 0xe0000
 38	},
 39	{
 40		.name		= "initrd",
 41		.offset		= MTDPART_OFS_APPEND,	
 42		.size		= MTDPART_SIZ_FULL
 43	}
 44};
 45
 46static struct flash_platform_data shannon_flash_data = {
 47	.map_name	= "cfi_probe",
 48	.parts		= shannon_partitions,
 49	.nr_parts	= ARRAY_SIZE(shannon_partitions),
 50};
 51
 52static struct resource shannon_flash_resource =
 53	DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_4M);
 54
 55static struct mcp_plat_data shannon_mcp_data = {
 56	.mccr0		= MCCR0_ADM,
 57	.sclk_rate	= 11981000,
 58};
 59
 60static struct sa1100fb_mach_info shannon_lcd_info = {
 61	.pixclock	= 152500,	.bpp		= 8,
 62	.xres		= 640,		.yres		= 480,
 63
 64	.hsync_len	= 4,		.vsync_len	= 3,
 65	.left_margin	= 2,		.upper_margin	= 0,
 66	.right_margin	= 1,		.lower_margin	= 0,
 67
 68	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
 69
 70	.lccr0		= LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
 71	.lccr3		= LCCR3_ACBsDiv(512),
 72};
 73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 74static void __init shannon_init(void)
 75{
 
 
 
 
 
 
 76	sa11x0_ppc_configure_mcp();
 
 77	sa11x0_register_lcd(&shannon_lcd_info);
 78	sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
 79	sa11x0_register_mcp(&shannon_mcp_data);
 80}
 81
 82static void __init shannon_map_io(void)
 83{
 84	sa1100_map_io();
 85
 86	sa1100_register_uart(0, 3);
 87	sa1100_register_uart(1, 1);
 88
 89	Ser1SDCR0 |= SDCR0_SUS;
 90	GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
 91	GPDR |= GPIO_UART_TXD | SHANNON_GPIO_CODEC_RESET;
 92	GPDR &= ~GPIO_UART_RXD;
 93	PPAR |= PPAR_UPR;
 94
 95	/* reset the codec */
 96	GPCR = SHANNON_GPIO_CODEC_RESET;
 97	GPSR = SHANNON_GPIO_CODEC_RESET;
 98}
 99
100MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
101	.atag_offset	= 0x100,
102	.map_io		= shannon_map_io,
103	.nr_irqs	= SA1100_NR_IRQS,
104	.init_irq	= sa1100_init_irq,
105	.init_time	= sa1100_timer_init,
106	.init_machine	= shannon_init,
107	.init_late	= sa11x0_init_late,
108	.restart	= sa11x0_restart,
109MACHINE_END
v5.9
  1// SPDX-License-Identifier: GPL-2.0
  2/*
  3 * linux/arch/arm/mach-sa1100/shannon.c
  4 */
  5
  6#include <linux/init.h>
  7#include <linux/device.h>
  8#include <linux/gpio/machine.h>
  9#include <linux/kernel.h>
 10#include <linux/platform_data/sa11x0-serial.h>
 11#include <linux/tty.h>
 12#include <linux/mtd/mtd.h>
 13#include <linux/mtd/partitions.h>
 14#include <linux/regulator/fixed.h>
 15#include <linux/regulator/machine.h>
 16
 17#include <video/sa1100fb.h>
 18
 19#include <mach/hardware.h>
 20#include <asm/mach-types.h>
 21#include <asm/setup.h>
 22
 23#include <asm/mach/arch.h>
 24#include <asm/mach/flash.h>
 25#include <asm/mach/map.h>
 26#include <linux/platform_data/mfd-mcp-sa11x0.h>
 27#include <mach/shannon.h>
 28#include <mach/irqs.h>
 29
 30#include "generic.h"
 31
 32static struct mtd_partition shannon_partitions[] = {
 33	{
 34		.name		= "BLOB boot loader",
 35		.offset		= 0,
 36		.size		= 0x20000
 37	},
 38	{
 39		.name		= "kernel",
 40		.offset		= MTDPART_OFS_APPEND,
 41		.size		= 0xe0000
 42	},
 43	{
 44		.name		= "initrd",
 45		.offset		= MTDPART_OFS_APPEND,	
 46		.size		= MTDPART_SIZ_FULL
 47	}
 48};
 49
 50static struct flash_platform_data shannon_flash_data = {
 51	.map_name	= "cfi_probe",
 52	.parts		= shannon_partitions,
 53	.nr_parts	= ARRAY_SIZE(shannon_partitions),
 54};
 55
 56static struct resource shannon_flash_resource =
 57	DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_4M);
 58
 59static struct mcp_plat_data shannon_mcp_data = {
 60	.mccr0		= MCCR0_ADM,
 61	.sclk_rate	= 11981000,
 62};
 63
 64static struct sa1100fb_mach_info shannon_lcd_info = {
 65	.pixclock	= 152500,	.bpp		= 8,
 66	.xres		= 640,		.yres		= 480,
 67
 68	.hsync_len	= 4,		.vsync_len	= 3,
 69	.left_margin	= 2,		.upper_margin	= 0,
 70	.right_margin	= 1,		.lower_margin	= 0,
 71
 72	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
 73
 74	.lccr0		= LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
 75	.lccr3		= LCCR3_ACBsDiv(512),
 76};
 77
 78static struct gpiod_lookup_table shannon_pcmcia0_gpio_table = {
 79	.dev_id = "sa11x0-pcmcia.0",
 80	.table = {
 81		GPIO_LOOKUP("gpio", 24, "detect", GPIO_ACTIVE_LOW),
 82		GPIO_LOOKUP("gpio", 26, "ready", GPIO_ACTIVE_HIGH),
 83		{ },
 84	},
 85};
 86
 87static struct gpiod_lookup_table shannon_pcmcia1_gpio_table = {
 88	.dev_id = "sa11x0-pcmcia.1",
 89	.table = {
 90		GPIO_LOOKUP("gpio", 25, "detect", GPIO_ACTIVE_LOW),
 91		GPIO_LOOKUP("gpio", 27, "ready", GPIO_ACTIVE_HIGH),
 92		{ },
 93	},
 94};
 95
 96static struct regulator_consumer_supply shannon_cf_vcc_consumers[] = {
 97	REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.0"),
 98	REGULATOR_SUPPLY("vcc", "sa11x0-pcmcia.1"),
 99};
100
101static struct fixed_voltage_config shannon_cf_vcc_pdata __initdata = {
102	.supply_name = "cf-power",
103	.microvolts = 3300000,
104	.enabled_at_boot = 1,
105};
106
107static struct gpiod_lookup_table shannon_display_gpio_table = {
108	.dev_id = "sa11x0-fb",
109	.table = {
110		GPIO_LOOKUP("gpio", 22, "shannon-lcden", GPIO_ACTIVE_HIGH),
111		{ },
112	},
113};
114
115static void __init shannon_init(void)
116{
117	sa11x0_register_fixed_regulator(0, &shannon_cf_vcc_pdata,
118					shannon_cf_vcc_consumers,
119					ARRAY_SIZE(shannon_cf_vcc_consumers),
120					false);
121	sa11x0_register_pcmcia(0, &shannon_pcmcia0_gpio_table);
122	sa11x0_register_pcmcia(1, &shannon_pcmcia1_gpio_table);
123	sa11x0_ppc_configure_mcp();
124	gpiod_add_lookup_table(&shannon_display_gpio_table);
125	sa11x0_register_lcd(&shannon_lcd_info);
126	sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
127	sa11x0_register_mcp(&shannon_mcp_data);
128}
129
130static void __init shannon_map_io(void)
131{
132	sa1100_map_io();
133
134	sa1100_register_uart(0, 3);
135	sa1100_register_uart(1, 1);
136
137	Ser1SDCR0 |= SDCR0_SUS;
138	GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
139	GPDR |= GPIO_UART_TXD | SHANNON_GPIO_CODEC_RESET;
140	GPDR &= ~GPIO_UART_RXD;
141	PPAR |= PPAR_UPR;
142
143	/* reset the codec */
144	GPCR = SHANNON_GPIO_CODEC_RESET;
145	GPSR = SHANNON_GPIO_CODEC_RESET;
146}
147
148MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
149	.atag_offset	= 0x100,
150	.map_io		= shannon_map_io,
151	.nr_irqs	= SA1100_NR_IRQS,
152	.init_irq	= sa1100_init_irq,
153	.init_time	= sa1100_timer_init,
154	.init_machine	= shannon_init,
155	.init_late	= sa11x0_init_late,
156	.restart	= sa11x0_restart,
157MACHINE_END