|
From: | Quentin YANG |
Subject: | Re: [Ltib] Failed to add ' dev:ssp1' on Phytec 3250 board. |
Date: | Fri, 13 Aug 2010 14:47:42 +1000 |
platform_add_devices(phy3250_devs,
ARRAY_SIZE(phy3250_devs));
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
printk(KERN_ALERT,"registered
amba device \n");
amba_device_register(d,
&iomem_resource);
}
Hi Quentin,
Please enable the Clock for SPI1 device (Code changes as shown below):
#ifdef CONFIG_SPI_PL022
tmp = __raw_readl(LPC32XX_CLKPWR_SSP_CLK_CTRL);
__raw_writel((tmp | (LPC32XX_CLKPWR_SSPCTRL_SSPCLK0_EN | LPC32XX_CLKPWR_SSPCTRL_SSPCLK1_EN)),
LPC32XX_CLKPWR_SSP_CLK_CTRL);
#endif
Regards,
Giri
-----------------------------------------------------------------
Bangaragiri G
E-mail: address@hidden
From: ltib-bounces+bangaragiri.g=nxp.com@nongnu.org [mailto:ltib-bounces+bangaragiri.g=nxp.com@nongnu.org] On Behalf Of Quentin YANG
Sent: 2010 Aug 13 6:20 AM
To: Kevin Wells
Cc: address@hidden
Subject: [Ltib] Failed to add ' dev:ssp1' on Phytec 3250 board.
Hi Kevin,
I've been trying to add another dev:ssp1 using LPC3250 ssp1 SPI Bus, which is originally reserved for LCD Pannel on Phytec3250 board.
I did following things, but could not see dev:ssp1 under /sys/devices/ .
It's still just showing:
address@hidden /]# ls /sys/devices
dev:mmc0 dev:ssp0 platform system
Two questions:
1. Apart from creation of a new amba_device 'dev:ssp1' and get it registered, what else I need to do to create 'dev:ssp1' that uses the second SPI bus port?
2. Why I cannot see "registered amba device" debugging message on either console print or 'dmesg' log, which I inserted to help the kernel debugging?
(see the printk() below)
I attached the 'dmesg' log of Phytec board.
ONE: amba_device Registering
----------------------------------------------------------
platform_add_devices(phy3250_devs, ARRAY_SIZE(phy3250_devs));
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
printk(KERN_ALERT,"registered amba device \n");
amba_device_register(d, &iomem_resource);
}
TWO:
I created one amba_device 'lpc32xx_ssp1_device' as below, and I removed 'clcd device'.
Also, in Kernel config, I removed the TOUCHSCREEN_SUPPORT. " # CONFIG_INPUT_TOUCHSCREEN is not set "
--------------------------------------------------------------------------------------------
static struct amba_device *amba_devs[] __initdata = {
/* &lpc32xx_clcd_device,*/
&lpc32xx_ssp0_device,
&lpc32xx_ssp1_device,
#if defined(CONFIG_MMC_ARMMMCI)
&lpc32xx_mmc_device,
#endif
};
THREE: new dev:ssp1 platform_device and platform_data is as follows
---------------------------------------------------------------------
/* SSP 1 */
static void phy3250_spi1_cs_set(u32 control)
{
/*gpio_set_value(SPI0_CS_GPIO, (int) control);*/
}
static struct pl022_config_chip spi1_chip_info = {
.lbm = LOOPBACK_DISABLED,
.com_mode = INTERRUPT_TRANSFER,
.iface = SSP_INTERFACE_MOTOROLA_SPI,
.hierarchy = SSP_MASTER,
.slave_tx_disable = 0,
.endian_tx = SSP_TX_LSB,
.endian_rx = SSP_RX_LSB,
.data_size = SSP_DATA_BITS_8,
.rx_lev_trig = SSP_RX_4_OR_MORE_ELEM,
.tx_lev_trig = SSP_TX_4_OR_MORE_EMPTY_LOC,
.clk_phase = SSP_CLK_FIRST_EDGE,
.clk_pol = SSP_CLK_POL_IDLE_LOW,
.ctrl_len = SSP_BITS_8,
.wait_state = SSP_MWIRE_WAIT_ZERO,
.duplex = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
.cs_control = phy3250_spi1_cs_set,
};
static struct pl022_ssp_controller lpc32xx_ssp1_data = {
.bus_id = 1, /* should match physical hardware spi bus number */
.num_chipselect = 1,
.enable_dma = 0,
};
static struct amba_device lpc32xx_ssp1_device = {
.dev = {
.coherent_dma_mask = ~0,
.init_name = "dev:ssp1",
.platform_data = &lpc32xx_ssp1_data,
},
.res = {
.start = LPC32XX_SSP1_BASE,
.end = (LPC32XX_SSP1_BASE + SZ_4K - 1),
.flags = IORESOURCE_MEM,
},
.dma_mask = ~0,
.irq = {IRQ_LPC32XX_SSP1, NO_IRQ},
};
Thanks very much. I am kind of stuck now. : - (
We are planning to buy TRACE32 to help Kernel debugging.
Just wonder what Hardware debugger are you using for Linux Kernel debugging???
Regards,
Quentin
[Prev in Thread] | Current Thread | [Next in Thread] |