[linux-sunxi] [PATCH] Add fex file for TBS A711 tablet
--- sys_config/a83t/tbs_a711.fex | 1293 ++ 1 file changed, 1293 insertions(+) create mode 100644 sys_config/a83t/tbs_a711.fex diff --git a/sys_config/a83t/tbs_a711.fex b/sys_config/a83t/tbs_a711.fex new file mode 100644 index 000..155a3e4 --- /dev/null +++ b/sys_config/a83t/tbs_a711.fex @@ -0,0 +1,1293 @@ +[product] +version = "100" +machine = "f1" + +[platform] +eraseflag = 0 +next_work = 3 + +[target] +boot_clock = 1008 +storage_type= -1 + +[key_detect_en] +keyen_flag = 1 + +[power_sply] +dcdc1_vol = 1003000 +dcdc2_vol = 1000900 +dcdc3_vol = 1000900 +dcdc4_vol = 1000900 +dcdc5_vol = 1001200 +dcdc6_vol = 1000900 +aldo1_vol = 1800 +aldo2_vol = 1001800 +aldo3_vol = 1003000 +eldo1_vol = 1001800 +eldo2_vol = 1800 +eldo3_vol = 0001800 +dldo1_vol = 2800 +dldo2_vol = 3000 +dldo3_vol = 0002800 +dldo4_vol = 0002800 +fldo2_vol = 1000900 +gpio0ldo_vol = 1003000 + +[gpio_bias] +;pa_bias = "axp81x:dcdc1:3000" +pb_bias = "axp81x:dcdc1:3000" +pc_bias = "axp81x:dcdc1:3000" +pd_bias = "axp81x:aldo1:1800" +pe_bias = "axp81x:dcdc1:3000" +pf_bias = "axp81x:dcdc1:3000" +pg_bias = "axp81x:dcdc1:3000" +ph_bias = "axp81x:dcdc1:3000" +pl_bias = "axp81x:aldo3:3000" + +[card_boot] +logical_start = 40960 +sprite_gpio0= +next_work = 3 + +[card0_boot_para] +card_ctrl = 0 +card_high_speed = 1 +card_line = 4 +sdc_d1 = port:PF00<2><1><2> +sdc_d0 = port:PF01<2><1><2> +sdc_clk = port:PF02<2><1><2> +sdc_cmd = port:PF03<2><1><2> +sdc_d3 = port:PF04<2><1><2> +sdc_d2 = port:PF05<2><1><2> + +[card2_boot_para] +card_ctrl = 2 +card_high_speed = 1 +card_line = 8 +sdc_cmd = port:PC06<3><1><2> +sdc_clk = port:PC05<3><1><2> +sdc_d0 = port:PC08<3><1><2> +sdc_d1 = port:PC09<3><1><2> +sdc_d2 = port:PC10<3><1><2> +sdc_d3 = port:PC11<3><1><2> +sdc_d4 = port:PC12<3><1><2> +sdc_d5 = port:PC13<3><1><2> +sdc_d6 = port:PC14<3><1><2> +sdc_d7 = port:PC15<3><1><2> +sdc_2xmode = 1 +sdc_ddrmode= 1 + +[twi_para] +twi_port= 0 +twi_scl = +twi_sda = + +[uart_para] +uart_debug_port = 0 +uart_debug_tx = port:PB09<2><1> +uart_debug_rx = port:PB10<2><1> + +[force_uart_para] +force_uart_port = 0 +force_uart_tx= port:PF02<3><1> +force_uart_rx= port:PF04<3><1> + +[jtag_para] +jtag_enable = 0 +jtag_ms = port:PF00<3> +jtag_ck = port:PF05<3> +jtag_do = port:PF03<3> +jtag_di = port:PF01<3> + +[clock] +pll_ve = 432 +;pll_periph = 600 +pll_gpu = 432 +pll_hsic= 480 +pll_de = 504 +apb2_parent = pll_periph +apb2= 40 + +[dram_para] +dram_clk= 732 +dram_type = 7 +dram_zq = 0x3bfb +dram_odt_en = 1 +dram_para1 = 0x10E4 +dram_para2 = 0x +dram_mr0= 0x1840 +dram_mr1= 0x40 +dram_mr2= 0x8 +dram_mr3= 0x2 +dram_tpr0 = 0x0048A192 +dram_tpr1 = 0x01B1B18d +dram_tpr2 = 0x00076052 +dram_tpr3 = 0 +dram_tpr4 = 0 +dram_tpr5 = 0 +dram_tpr6 = 0 +dram_tpr7 = 0 +dram_tpr8 = 1 +dram_tpr9 = 0x0500 +dram_tpr10 = 0x +dram_tpr11 = 0x05005 +dram_tpr12 = 0 +dram_tpr13 = 0xC00 + +[gmac0] +gmac_used = 0 +gmac_txd0 = +gmac_txd1 = +gmac_txd2 = +gmac_txd3 = +gmac_txd4 = +gmac_txd5 = +gmac_txd6 = +gmac_txd7 = +gmac_txclk = +gmac_txen = +gmac_gtxclk= +gmac_rxd0 = +gmac_rxd1 = +gmac_rxd2 = +gmac_rxd3 = +gmac_rxd4 = +gmac_rxd5 = +gmac_rxd6 = +gmac_rxd7 = +gmac_rxdv = +gmac_rxclk = +gmac_txerr = +gmac_rxerr = +gmac_col = +gmac_crs = +gmac_clkin = +gmac_mdc = +gmac_mdio = + +[wakeup_src_para] +wakeup_src0 = +wakeup_src_wl = port:PL04<6><0> +wakeup_src_bt = port:PL05<6><0> +bb_wake_ap = port:PL11<6><0> + +[pm_para] +standby_mode = 1 + +[sys_pwr_dm_para] + +[dynamic_standby_para] +enable = 0 +dram_selfresh_flag = 1 + +[twi0] +twi_used= 1 +twi_scl = port:PH0<2> +twi_sda = port:PH1<2> + +[twi1] +twi_used= 1 +twi_scl = port:PH2<2> +twi_sda = port:PH3<2> + +[twi2] +twi_used= 0 +twi_scl = port:PH4<2> +twi_sda = port:PH5<2> + +[uart0] +uart_used = 1 +uart_port
[linux-sunxi] Few A83T tablets for development
Hi, we are using A83T + AXP813 based tablet [1]. Some of them are wrong (e.g. scratches on the screen, missing logo; roughly 5 pieces) so we cannot use them, but they are ok for a development or testing. If there is anybody interested please let me know. Tomas [1] http://linux-sunxi.org/TBS_A711 -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [linux-sunxi] Re: [RFC] Serial number on sunxi devices
Hi, On Wed, 18 Mar 2015 09:12:47 +0100, Henrik Nordström hen...@familjen-nordstrom.se wrote: ons 2015-03-18 klockan 08:55 +0100 skrev Olliver Schinagl: I'm all for common methods, but you are suggesting to use a single dedicated page purely for the MAC address? Where is it defined which page that is? And what about using the subsequent page for stuff like a crc/checksum and verify the mac against that? It would yield in an easy way to verify if there is actually a MAC stored there or not. What I am saying is that unless you are doing a very high volume then the most practical approach to get a real MAC is to buy them as preprogrammed eeproms, for example Microchip 24AA02E48. There is no checksum what so ever in these devices, only the MAC at a predefined location (write protected). There is also some small amount of unprotected space for custom data if needed (can often be protected after programming). Yes, this is exactly our case. We have LIME with additional board with Microchip MCP79401. This is RTC+EEPROM with preprogrammed (and somehow protected) MAC. That particular EEPROM has only 64-bits without any checksum. I just trust that the MAC is stored in I2C EEPROM at address X in a register Y. Best regards, Tomas Regards Henrik -- You received this message because you are subscribed to the Google Groups linux-sunxi group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [linux-sunxi] [PATCH] fex: a10: Fix SPI0 pins function
Hi, On Thu, 13 Nov 2014 18:17:14 +0100, Tomas Novotny to...@novotny.cz wrote: SPI0 on A10 has pin function 2 according to the A10 Datasheet V1.70. So fix the wrong configuration even if the SPI is disabled. Boards Iteaduino Plus A10 and pcDuino are using SPI0 already and the configuration is correct. Fixed configuration was tested on A10-OLinuXino-LIME. Signed-off-by: Tomas Novotny to...@novotny.cz Gentle ping, this simple fix should go to sunxi-boards. Thanks, Tomas --- sys_config/a10/a10-olinuxino-lime.fex | 8 sys_config/a10/a10_mid_1gb.fex| 8 sys_config/a10/ba10_tv_box.fex| 8 sys_config/a10/coby_mid7042.fex | 10 +- sys_config/a10/coby_mid8042.fex | 8 sys_config/a10/coby_mid9742.fex | 8 sys_config/a10/cubieboard.fex | 8 sys_config/a10/cubieboard_512.fex | 8 sys_config/a10/dns_m82.fex| 10 +- sys_config/a10/eoma68_a10.fex | 8 sys_config/a10/gooseberry_a721.fex| 10 +- sys_config/a10/h6.fex | 10 +- sys_config/a10/hackberry.fex | 8 sys_config/a10/hcore_hc860.fex| 8 sys_config/a10/hyundai_a7.fex | 10 +- sys_config/a10/hyundai_a7hd.fex | 8 sys_config/a10/inet97f-ii.fex | 8 sys_config/a10/inet_3fbt.fex | 10 +- sys_config/a10/jesurun-q5.fex | 8 sys_config/a10/marsboard_a10.fex | 8 sys_config/a10/mele_a1000.fex | 8 sys_config/a10/mele_a1000g.fex| 8 sys_config/a10/mele_a3700.fex | 8 sys_config/a10/mini-x-1gb.fex | 8 sys_config/a10/mini-x.fex | 8 sys_config/a10/mk802-1gb.fex | 10 +- sys_config/a10/mk802.fex | 10 +- sys_config/a10/mk802ii.fex| 8 sys_config/a10/pov_protab2_ips9.fex | 8 sys_config/a10/pov_protab2_ips_3g.fex | 8 sys_config/a10/sanei_n90.fex | 10 +- sys_config/a10/t702a.fex | 8 sys_config/a10/uhost_u1a.fex | 8 sys_config/a10/yarvik_tab260.fex | 10 +- sys_config/a10/zatab.fex | 8 35 files changed, 150 insertions(+), 150 deletions(-) diff --git a/sys_config/a10/a10-olinuxino-lime.fex b/sys_config/a10/a10-olinuxino-lime.fex index 7f0c1b8..e478aec 100644 --- a/sys_config/a10/a10-olinuxino-lime.fex +++ b/sys_config/a10/a10-olinuxino-lime.fex @@ -197,10 +197,10 @@ uart_rx = port:PA1541defaultdefault [spi0_para] spi_used = 0 spi_cs_bitmap = 1 -spi_cs0 = port:PI103defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault +spi_miso = port:PI132defaultdefaultdefault [spi1_para] spi_used = 0 diff --git a/sys_config/a10/a10_mid_1gb.fex b/sys_config/a10/a10_mid_1gb.fex index 03c246b..abb857b 100644 --- a/sys_config/a10/a10_mid_1gb.fex +++ b/sys_config/a10/a10_mid_1gb.fex @@ -206,10 +206,10 @@ uart_rx = port:PA154defaultdefaultdefault [spi0_para] spi_used = 0 spi_cs_bitmap = 1 -spi_cs0 = port:PI103defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault +spi_miso = port:PI132defaultdefaultdefault [spi1_para] spi_used = 0 diff --git a/sys_config/a10/ba10_tv_box.fex b/sys_config/a10/ba10_tv_box.fex index 29fef43..941aee0 100644 --- a/sys_config/a10/ba10_tv_box.fex +++ b/sys_config/a10/ba10_tv_box.fex @@ -199,10 +199,10 @@ uart_rx = port:PA1541defaultdefault [spi0_para] spi_used = 0 spi_cs_bitmap = 1 -spi_cs0 = port:PI103defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault +spi_miso = port:PI132defaultdefaultdefault [spi1_para] spi_used = 0 diff --git a/sys_config/a10/coby_mid7042.fex b/sys_config/a10/coby_mid7042.fex index 90bea27..f1383ff 100644 --- a/sys_config/a10/coby_mid7042.fex +++ b/sys_config/a10/coby_mid7042.fex @@ -176,11 +176,11 @@ uart_tx = port:PA144defaultdefaultdefault uart_rx = port:PA154defaultdefaultdefault [spi0_para] spi_used = 0 -spi_cs0 = port:PI103defaultdefaultdefault -spi_cs1 = port:PI143defaultdefaultdefault -spi_sclk
[linux-sunxi] [PATCH] fex: a10: Fix SPI0 pins function
SPI0 on A10 has pin function 2 according to the A10 Datasheet V1.70. So fix the wrong configuration even if the SPI is disabled. Boards Iteaduino Plus A10 and pcDuino are using SPI0 already and the configuration is correct. Fixed configuration was tested on A10-OLinuXino-LIME. Signed-off-by: Tomas Novotny to...@novotny.cz --- sys_config/a10/a10-olinuxino-lime.fex | 8 sys_config/a10/a10_mid_1gb.fex| 8 sys_config/a10/ba10_tv_box.fex| 8 sys_config/a10/coby_mid7042.fex | 10 +- sys_config/a10/coby_mid8042.fex | 8 sys_config/a10/coby_mid9742.fex | 8 sys_config/a10/cubieboard.fex | 8 sys_config/a10/cubieboard_512.fex | 8 sys_config/a10/dns_m82.fex| 10 +- sys_config/a10/eoma68_a10.fex | 8 sys_config/a10/gooseberry_a721.fex| 10 +- sys_config/a10/h6.fex | 10 +- sys_config/a10/hackberry.fex | 8 sys_config/a10/hcore_hc860.fex| 8 sys_config/a10/hyundai_a7.fex | 10 +- sys_config/a10/hyundai_a7hd.fex | 8 sys_config/a10/inet97f-ii.fex | 8 sys_config/a10/inet_3fbt.fex | 10 +- sys_config/a10/jesurun-q5.fex | 8 sys_config/a10/marsboard_a10.fex | 8 sys_config/a10/mele_a1000.fex | 8 sys_config/a10/mele_a1000g.fex| 8 sys_config/a10/mele_a3700.fex | 8 sys_config/a10/mini-x-1gb.fex | 8 sys_config/a10/mini-x.fex | 8 sys_config/a10/mk802-1gb.fex | 10 +- sys_config/a10/mk802.fex | 10 +- sys_config/a10/mk802ii.fex| 8 sys_config/a10/pov_protab2_ips9.fex | 8 sys_config/a10/pov_protab2_ips_3g.fex | 8 sys_config/a10/sanei_n90.fex | 10 +- sys_config/a10/t702a.fex | 8 sys_config/a10/uhost_u1a.fex | 8 sys_config/a10/yarvik_tab260.fex | 10 +- sys_config/a10/zatab.fex | 8 35 files changed, 150 insertions(+), 150 deletions(-) diff --git a/sys_config/a10/a10-olinuxino-lime.fex b/sys_config/a10/a10-olinuxino-lime.fex index 7f0c1b8..e478aec 100644 --- a/sys_config/a10/a10-olinuxino-lime.fex +++ b/sys_config/a10/a10-olinuxino-lime.fex @@ -197,10 +197,10 @@ uart_rx = port:PA1541defaultdefault [spi0_para] spi_used = 0 spi_cs_bitmap = 1 -spi_cs0 = port:PI103defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault +spi_miso = port:PI132defaultdefaultdefault [spi1_para] spi_used = 0 diff --git a/sys_config/a10/a10_mid_1gb.fex b/sys_config/a10/a10_mid_1gb.fex index 03c246b..abb857b 100644 --- a/sys_config/a10/a10_mid_1gb.fex +++ b/sys_config/a10/a10_mid_1gb.fex @@ -206,10 +206,10 @@ uart_rx = port:PA154defaultdefaultdefault [spi0_para] spi_used = 0 spi_cs_bitmap = 1 -spi_cs0 = port:PI103defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault +spi_miso = port:PI132defaultdefaultdefault [spi1_para] spi_used = 0 diff --git a/sys_config/a10/ba10_tv_box.fex b/sys_config/a10/ba10_tv_box.fex index 29fef43..941aee0 100644 --- a/sys_config/a10/ba10_tv_box.fex +++ b/sys_config/a10/ba10_tv_box.fex @@ -199,10 +199,10 @@ uart_rx = port:PA1541defaultdefault [spi0_para] spi_used = 0 spi_cs_bitmap = 1 -spi_cs0 = port:PI103defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault +spi_miso = port:PI132defaultdefaultdefault [spi1_para] spi_used = 0 diff --git a/sys_config/a10/coby_mid7042.fex b/sys_config/a10/coby_mid7042.fex index 90bea27..f1383ff 100644 --- a/sys_config/a10/coby_mid7042.fex +++ b/sys_config/a10/coby_mid7042.fex @@ -176,11 +176,11 @@ uart_tx = port:PA144defaultdefaultdefault uart_rx = port:PA154defaultdefaultdefault [spi0_para] spi_used = 0 -spi_cs0 = port:PI103defaultdefaultdefault -spi_cs1 = port:PI143defaultdefaultdefault -spi_sclk = port:PI113defaultdefaultdefault -spi_mosi = port:PI123defaultdefaultdefault -spi_miso = port:PI133defaultdefaultdefault +spi_cs0 = port:PI102defaultdefaultdefault +spi_cs1 = port:PI142defaultdefaultdefault +spi_sclk = port:PI112defaultdefaultdefault +spi_mosi = port:PI122defaultdefaultdefault
Re: [linux-sunxi] Re: Passing the platform data for SPI device
On Mon, 27 Jan 2014 08:42:51 -0800 (PST), vinicius...@gmail.com vinicius...@gmail.com wrote: Em quinta-feira, 23 de janeiro de 2014 17h24min27s UTC-3, Tomas Novotny escreveu: On Thu, 23 Jan 2014 19:11:32 +0100, Gustavo Zamboni gustavozamb...@gmail.com wrote: Hi Gustavo, Why dont you just add the device to the fex file ?? activate your spix_para parameters and add something like: |[spi_devices]| spi_dev_num=1 |[spi_board0]| |modalias| |= |||mcp251x |max_speed_hz| |= ||1200| |bus_num| |= ||1| |chip_select| |= ||0| |mode| |= ||3| |full_duplex| |= ||0| |manual_cs| |= ||0| With spidev it works well with modalias spidev. yes, this is exactly what I did. I was trying both spidev and mcp251x. There is no problem with spidev (it is currently working) but for mcp251x I need to pass (very simple) platform data with oscillator frequency. The mcp251x is being initialized during boot but it fails because of missing platform data. I don't know if there is some clean way how to pass platform data of the mcp251x driver. I think that FEX is not able to do that (there is no handling in sunxi spi). Thanks for you answer, Tomas Gustavo Zamboni Le 23/01/2014 18:03, vinicius...@gmail.com a écrit : Em quinta-feira, 23 de janeiro de 2014 13h59min19s UTC-3, vinic...@gmail.com escreveu: Em terça-feira, 21 de janeiro de 2014 08h44min19s UTC-3, Tomas Novotny escreveu: Hi All, I'm trying to use some SPI devices on A10s OLinuXino. It was flawless for simple MCU driven by spidev (everything needed is defined in FEX). Now I'm trying to connect external CAN over SPI (MCP2515). The mcp251x driver needs to pass oscillator frequency through the mcp251x_platform_data structure. Is there any clean way how to do it on 3.4 linux-sunxi? It seems that platform data for SPI board aren't passed by sunxi SPI driver. I'm using Debian image with custom built 3.4.61 linux-sunxi. Thanks to all, Tomas You can change by yourself spi_sunxi.c, something like that: diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c index a3792fd..2f0ab7c 100644 --- a/drivers/spi/spi_sunxi.c +++ b/drivers/spi/spi_sunxi.c @@ -28,6 +28,7 @@ #include linux/spi/spi.h #include linux/spi/spi_bitbang.h +#include linux/can/platform/mcp251x.h #include asm/io.h #include plat/dma.h @@ -134,6 +135,10 @@ struct sunxi_spi { int cs_bitmap;/* cs0- 0x1; cs1-0x2, cs0cs1-0x3. */ }; +static struct mcp251x_platform_data mcp251x_info = { + .oscillator_frequency = 800, +}; + Sorry, something like that: diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c index a3792fd..2f0ab7c 100644 --- a/drivers/spi/spi_sunxi.c +++ b/drivers/spi/spi_sunxi.c @@ -28,6 +28,7 @@ #include linux/spi/spi.h #include linux/spi/spi_bitbang.h +#include linux/can/platform/mcp251x.h #include asm/io.h #include plat/dma.h @@ -134,6 +135,10 @@ struct sunxi_spi { int cs_bitmap;/* cs0- 0x1; cs1-0x2, cs0cs1-0x3. */ }; +static struct mcp251x_platform_data mcp251x_info = { + .oscillator_frequency = 800, +}; + /* config chip select */ s32 aw_spi_set_cs(u32 chipselect, void *base_addr) { @@ -1922,6 +1927,7 @@ int __devinit spi_sunxi_register_spidev(void) { board = spi_boards[i]; sprintf(spi_board_name, spi_board%d, i); +board-platform_data = mcp251x_info; ret = script_parser_fetch(spi_board_name, modalias, (void*)board-modalias, sizeof(char*)); if(ret != SCRIPT_PARSER_OK) { spi_msg(Get spi devices modalias failed\n); Hi Tomas, your fex is ok, now you just change spi_sunxi.c as suggested or the way you think best, that is enough. Hi Vinicius, finally the osc frequency was harcoded to mcp251x driver and the device is now being initialized. I was just curious if there is some clean way. Unfortunately mcp chip is not working yet as there is some problem with communication over spi. I will check spi with some analyzer soon. But this is different story... Thanks
Re: [linux-sunxi] Re: Passing the platform data for SPI device
On Thu, 23 Jan 2014 09:03:28 -0800 (PST), vinicius...@gmail.com vinicius...@gmail.com wrote: Em quinta-feira, 23 de janeiro de 2014 13h59min19s UTC-3, vinic...@gmail.com escreveu: Em terça-feira, 21 de janeiro de 2014 08h44min19s UTC-3, Tomas Novotny escreveu: Hi All, I'm trying to use some SPI devices on A10s OLinuXino. It was flawless for simple MCU driven by spidev (everything needed is defined in FEX). Now I'm trying to connect external CAN over SPI (MCP2515). The mcp251x driver needs to pass oscillator frequency through the mcp251x_platform_data structure. Is there any clean way how to do it on 3.4 linux-sunxi? It seems that platform data for SPI board aren't passed by sunxi SPI driver. I'm using Debian image with custom built 3.4.61 linux-sunxi. Thanks to all, Tomas You can change by yourself spi_sunxi.c, something like that: diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c index a3792fd..2f0ab7c 100644 --- a/drivers/spi/spi_sunxi.c +++ b/drivers/spi/spi_sunxi.c @@ -28,6 +28,7 @@ #include linux/spi/spi.h #include linux/spi/spi_bitbang.h +#include linux/can/platform/mcp251x.h #include asm/io.h #include plat/dma.h @@ -134,6 +135,10 @@ struct sunxi_spi { int cs_bitmap;/* cs0- 0x1; cs1-0x2, cs0cs1-0x3. */ }; +static struct mcp251x_platform_data mcp251x_info = { + .oscillator_frequency = 800, +}; + Sorry, something like that: diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c index a3792fd..2f0ab7c 100644 --- a/drivers/spi/spi_sunxi.c +++ b/drivers/spi/spi_sunxi.c @@ -28,6 +28,7 @@ #include linux/spi/spi.h #include linux/spi/spi_bitbang.h +#include linux/can/platform/mcp251x.h #include asm/io.h #include plat/dma.h @@ -134,6 +135,10 @@ struct sunxi_spi { int cs_bitmap;/* cs0- 0x1; cs1-0x2, cs0cs1-0x3. */ }; +static struct mcp251x_platform_data mcp251x_info = { + .oscillator_frequency = 800, +}; + /* config chip select */ s32 aw_spi_set_cs(u32 chipselect, void *base_addr) { @@ -1922,6 +1927,7 @@ int __devinit spi_sunxi_register_spidev(void) { board = spi_boards[i]; sprintf(spi_board_name, spi_board%d, i); +board-platform_data = mcp251x_info; ret = script_parser_fetch(spi_board_name, modalias, (void*)board-modalias, sizeof(char*)); if(ret != SCRIPT_PARSER_OK) { spi_msg(Get spi devices modalias failed\n); Hi, yes, I know that there are these dirty ways how to do it. In fact I was thinking about similar way as a last option. I will probably hardcode oscillator frequency directly to the mcp251x driver if there is no clean way how to pass platform data through FEX. Thanks for your answer, Tomas -- You received this message because you are subscribed to the Google Groups linux-sunxi group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [linux-sunxi] Re: Passing the platform data for SPI device
On Thu, 23 Jan 2014 19:11:32 +0100, Gustavo Zamboni gustavozamb...@gmail.com wrote: Hi Gustavo, Why dont you just add the device to the fex file ?? activate your spix_para parameters and add something like: |[spi_devices]| spi_dev_num=1 |[spi_board0]| |modalias| |= |||mcp251x |max_speed_hz| |= ||1200| |bus_num| |= ||1| |chip_select| |= ||0| |mode| |= ||3| |full_duplex| |= ||0| |manual_cs| |= ||0| With spidev it works well with modalias spidev. yes, this is exactly what I did. I was trying both spidev and mcp251x. There is no problem with spidev (it is currently working) but for mcp251x I need to pass (very simple) platform data with oscillator frequency. The mcp251x is being initialized during boot but it fails because of missing platform data. I don't know if there is some clean way how to pass platform data of the mcp251x driver. I think that FEX is not able to do that (there is no handling in sunxi spi). Thanks for you answer, Tomas Gustavo Zamboni Le 23/01/2014 18:03, vinicius...@gmail.com a écrit : Em quinta-feira, 23 de janeiro de 2014 13h59min19s UTC-3, vinic...@gmail.com escreveu: Em terça-feira, 21 de janeiro de 2014 08h44min19s UTC-3, Tomas Novotny escreveu: Hi All, I'm trying to use some SPI devices on A10s OLinuXino. It was flawless for simple MCU driven by spidev (everything needed is defined in FEX). Now I'm trying to connect external CAN over SPI (MCP2515). The mcp251x driver needs to pass oscillator frequency through the mcp251x_platform_data structure. Is there any clean way how to do it on 3.4 linux-sunxi? It seems that platform data for SPI board aren't passed by sunxi SPI driver. I'm using Debian image with custom built 3.4.61 linux-sunxi. Thanks to all, Tomas You can change by yourself spi_sunxi.c, something like that: diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c index a3792fd..2f0ab7c 100644 --- a/drivers/spi/spi_sunxi.c +++ b/drivers/spi/spi_sunxi.c @@ -28,6 +28,7 @@ #include linux/spi/spi.h #include linux/spi/spi_bitbang.h +#include linux/can/platform/mcp251x.h #include asm/io.h #include plat/dma.h @@ -134,6 +135,10 @@ struct sunxi_spi { int cs_bitmap;/* cs0- 0x1; cs1-0x2, cs0cs1-0x3. */ }; +static struct mcp251x_platform_data mcp251x_info = { + .oscillator_frequency = 800, +}; + Sorry, something like that: diff --git a/drivers/spi/spi_sunxi.c b/drivers/spi/spi_sunxi.c index a3792fd..2f0ab7c 100644 --- a/drivers/spi/spi_sunxi.c +++ b/drivers/spi/spi_sunxi.c @@ -28,6 +28,7 @@ #include linux/spi/spi.h #include linux/spi/spi_bitbang.h +#include linux/can/platform/mcp251x.h #include asm/io.h #include plat/dma.h @@ -134,6 +135,10 @@ struct sunxi_spi { int cs_bitmap;/* cs0- 0x1; cs1-0x2, cs0cs1-0x3. */ }; +static struct mcp251x_platform_data mcp251x_info = { + .oscillator_frequency = 800, +}; + /* config chip select */ s32 aw_spi_set_cs(u32 chipselect, void *base_addr) { @@ -1922,6 +1927,7 @@ int __devinit spi_sunxi_register_spidev(void) { board = spi_boards[i]; sprintf(spi_board_name, spi_board%d, i); +board-platform_data = mcp251x_info; ret = script_parser_fetch(spi_board_name, modalias, (void*)board-modalias, sizeof(char*)); if(ret != SCRIPT_PARSER_OK) { spi_msg(Get spi devices modalias failed\n); -- You received this message because you are subscribed to the Google Groups linux-sunxi group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[linux-sunxi] Passing the platform data for SPI device
Hi All, I'm trying to use some SPI devices on A10s OLinuXino. It was flawless for simple MCU driven by spidev (everything needed is defined in FEX). Now I'm trying to connect external CAN over SPI (MCP2515). The mcp251x driver needs to pass oscillator frequency through the mcp251x_platform_data structure. Is there any clean way how to do it on 3.4 linux-sunxi? It seems that platform data for SPI board aren't passed by sunxi SPI driver. I'm using Debian image with custom built 3.4.61 linux-sunxi. Thanks to all, Tomas -- You received this message because you are subscribed to the Google Groups linux-sunxi group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[linux-sunxi] [PATCH] gpio: sunxi: Add interrupt (eint) definitions for A10s SoC
Interrupt definitions are taken from the A10s datasheet. Tested on A10s-OLinuXino-MICRO. Signed-off-by: Tomas Novotny novo...@rehivetech.com --- drivers/gpio/gpio-sunxi.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/gpio/gpio-sunxi.c b/drivers/gpio/gpio-sunxi.c index 6e86142..b25fce5 100644 --- a/drivers/gpio/gpio-sunxi.c +++ b/drivers/gpio/gpio-sunxi.c @@ -343,6 +343,30 @@ static void __devinit sunxi_gpio_eint_probe(void) gpio_eint_list = a10; gpio_eint_count = 32; + } else if (sunxi_is_a10s()) { + /* +* Pins that can be used as interrupt source: +* PG00 - PG13, PE00 - PE01, PB02 - PB14, PB19 - PB20, PA17 +* All in mux6 mode. +* A-0 B-1 C-2 D-3 E-4 F-5 G-6 +*/ + + static struct gpio_eint_data a10s[] = { + {6, 0, 6, 0}, {6, 1, 6, 1}, {6, 2, 6, 2}, {6, 3, 6, 3}, + {6, 4, 6, 4}, {6, 5, 6, 5}, {6, 6, 6, 6}, {6, 7, 6, 7}, + {6, 8, 6, 8}, {6, 9, 6, 9}, {6, 10, 6, 10}, {6, 11, 6, 11}, + {6, 12, 6, 12}, {6, 13, 6, 13}, + {4, 0, 6, 14}, {4, 1, 6, 15}, + {1, 2, 6, 16}, {1, 3, 6, 17}, {1, 4, 6, 18}, {1, 5, 6, 19}, + {1, 6, 6, 20}, {1, 7, 6, 21}, {1, 8, 6, 22}, {1, 9, 6, 23}, + {1, 10, 6, 24}, {1, 11, 6, 25}, {1, 12, 6, 26}, {1, 13, 6, 27}, + {1, 14, 6, 28}, {1, 19, 6, 29}, {1, 20, 6, 30}, {0, 17, 6, 31}, + + {-1, -1, -1, -1}, + }; + + gpio_eint_list = a10s; + gpio_eint_count = 32; } else if (sunxi_is_a13()) { /* Pins that can be used as interrupt source */ /* PG00 - PG04, PG09 - PG12, PE00 - PE01, PB02 - PB04, PB10 (all in mux6 mode) */ -- 1.7.11.3 -- You received this message because you are subscribed to the Google Groups linux-sunxi group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.