Quantcast
Channel: Forum - Recent Threads
Viewing all 1583 articles
Browse latest View live

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

> But I'm not using any SD card, should I change something else in my kernel configuration?

If you are not using SD, you can just delete all those lines. You can also remove CONFIG_MMC_SDHI from menuconfig if you want.

What I did was put EVERYTHING in the board-rskrza1.c file (even things that conflicted) so user could then go through and delete all the lines of code that do not apply to their board.

Do you see anything activity on the I2C lines at all? I would think at during the probe during boot-up, the kernel would at least try to access the touchscreen IC.

Another thing you can do is what what happens when you try to manually read the touchscreen over I2C.

In the board-rskrza1.c, there is a 'heartbeat' function that blinks the LEDs on the RSK board. The LEDs are connected to a I2C port expanded, meaning I have to use I2C in order to turn the LEDs on and off.

So, you can use those functions as sample code.

Then you can at least make sure the I2C port is configured correctly and you can talk to the chip OK.

> As you can see I changed i2c device section from: i2c_board_info i2c3_de0ices[] to i2c_board_info i2c3_devices[].

huh? change "i2c3" to "i2c3"??

Are you sure you are registering your touchscreen on the correct I2C bus?


RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

i2cdetect -r 3 returns this:

    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                            

00:          -- -- -- -- -- -- -- -- -- -- -- -- --                            

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

30: -- -- -- -- -- -- -- -- 38 -- -- -- 3c -- -- --                            

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

70: -- -- -- -- -- -- -- --

So I suppose that I2c works fine, any other I2C line returns:

    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                            

00:          -- -- -- -- -- -- -- -- -- -- -- -- --                            

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                            

70: -- -- -- -- -- -- -- --

>huh? change "i2c3" to "i2c3"??

ouch, there's a typo, I mean:

As you can see I changed i2c device section from: i2c_board_info i2c0_devices[] to i2c_board_info i2c3_devices[].

Looking at the board schematics I can see that the only I2C connection available is I2C3, and I connected SDA and SCL from touchscreen to thoose lines.

RZ A1 M custom board SCIF with DMA

$
0
0

Hi,

I am using the the RZ A1 M cpu on a custom board. The debug port (console terminal) is connected to the SCIF3. Everything is working fine, except when I try to send a file through the debug port, I got overrun error. When I add delay between line sent, there is no error message. I heard that when using the SCIF with DMA, it can reduce the overrun error and therefore, removing delay or lowering it.

I tried to add the DMA but with no luck. I am receiving the kernel debug log on startup, but it stop before the login prompt and I cannot write anything.

Here is the change I have made in the linux kernel in board-rskrza1.c

Added slave config in rza1_dma_slaves[] list

{
.slave_id = RZA1DMA_SLAVE_SCIF3_TX,
.addr = 0xe800880c,
.chcfg = CHCFG(0x1, 0x0, 0x1, 0x1, 0x2, 0x1, 0x1, 0x0),
.dmars = DMARS(0x1, 0x1b),
},
{
.slave_id = RZA1DMA_SLAVE_SCIF3_RX,
.addr = 0xe8008814,
.chcfg = CHCFG(0x0, 0x0, 0x1, 0x1, 0x2, 0x1, 0x1, 0x0),
.dmars = DMARS(0x2, 0x1b),
},

added the slave id in plat_sci_port

static const struct plat_sci_port scif3_platform_data = {
.type = PORT_SCIF,
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.dma_slave_tx = RZA1DMA_SLAVE_SCIF3_TX,
.dma_slave_rx = RZA1DMA_SLAVE_SCIF3_RX,
};

Am I forgetting something or doing something wrong?

Do any one of you have tried with success for using SCIF with DMA?

Thank for your help,

ABSysacom

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

Ok, I made a mistake in the interrupt configuration, I'm using P5_8 which is IRQ0, here are the lines I modified:

void __iomem *irc1 = IOMEM(0xfcfef802);

__raw_writew((__raw_readw(irc1) & ~(0x3)), irc1);

rza1_pfc_pin_assign(P5_8, ALT8, DIR_OUT);

As you can see I changed it so that now it writes 0x3 in the first 1 bits of the register.

I also modified this part of the code:

static const struct i2c_board_info i2c3_devices[] __initconst = {

{

I2C_BOARD_INFO("ft5x06-ts", 0x38),

.platform_data = &ft5216_pdata,

.irq = 32,

},

I changed .irq = 33 to .irq = 32.

But well...IRQ0 is for the timer so...

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

Hi,

You should read the "RZ/A1H Group, RZ/A1M Group User’s Manual: Hardware" Rev.2.0, Feb 2015.

I think

rza1_pfc_pin_assign(P5_8, ALT8, DIR_OUT);

should be:

rza1_pfc_pin_assign(P5_8, ALT2, DIR_PIPC);

Regards,

> But well...IRQ0 is for the timer so...

Are you developing the software for x86 PC?  ;-P

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

I've been setting IRQ pins to DIIO_PBDC_DIS which also seems to work fine

r7s72100_pfc_pin_assign(P5_8, ALT2, DIIO_PBDC_DIS);  /* IRQ0 */

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

I tried both solutions, but if I try cat /proc/interrupts I see nothing.

Also I'm still missing /dev/input/event0.

Thank you again for your help!

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

> I tried both solutions, but if I try cat /proc/interrupts I see nothing.

Changing the r7s72100_pfc_pin_assign is not going to fix that you don't have anything under /proc/interrupts.

You should put a printk in drivers/input/touchscreen/ft5x06_ts.c in the function ft5x06_ts_probe( ) to see if that even gets called.

This is the part in the probe that will register the IRQ: (if it gets that far)

	/* gpio irq handler register */
	error = request_irq(client->irq, ft5x06_ts_isr, 0, "ft5x06_ts", ts);

> Also I'm still missing /dev/input/event0.

Make sure you also have CONFIG_INPUT_EVDEV enabled as it mentions here:

https://github.com/renesas-rz/rskrza1_bsp/blob/master/doc/kernel_drivers.txt#L193


RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

CONFIG_INPUT_EVDEV is enabled, now I'm trying the printk

RE: RZA1 RSK Adding Device Tree Node for MMC0

$
0
0

Honestly, I would say at first, just comment out

      ret = wlcore_probe_of(&func->dev, &irq, &pdev_data);

and just hard code the values to get the driver up and running.

Yes, the correct thing would be to figure out how to get a wl1271 DT node to show up.

The one thing you could try is making the wlcore node as a separate node (not a sub-node of mmc....since the RZ sdhi driver is not set up for DT, so maybe that entire node is ignored which is why the TI driver can never find it.)

I don't see anything in wlcore_probe_of() where it needs to look at the parent node (the mmc node) to get anything from it.

RZA1 RSK Adding Device Tree Node for MMC0

$
0
0

I need to use the latest backported drivers from TI to support a radio with the RZA1. Previous versions of these drivers supported platform data set from a board file, or device tree data. Now, the latest drivers only support the device tree. The radio connects to the RZA1 RSK in the SD card slot, and so the kernel refers to this as device "mmc0":

mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: new high speed SDIO card at address 0001

The board file that ships with the RZA1 uses a hybrid model with most things being defined in board-rskrza1.c and some things defined in r7272100.dtsi and r7s72100-rskrza1.dts. The sd card slot is defined in the board file with these lines:

/* SDHI1 */
static struct sh_mobile_sdhi_info sdhi1_pdata = {
    .dma_slave_tx = RZA1DMA_SLAVE_SDHI1_TX,
    .dma_slave_rx = RZA1DMA_SLAVE_SDHI1_RX,
    .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
    .tmio_ocr_mask = MMC_VDD_32_33,
    .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
};

static const struct resource sdhi1_resources[] __initconst = {
    DEFINE_RES_MEM_NAMED(0xe804e800, 0x100, "SDHI1"),
    DEFINE_RES_IRQ_NAMED(gic_iid(305), SH_MOBILE_SDHI_IRQ_CARD_DETECT),
    DEFINE_RES_IRQ_NAMED(gic_iid(306), SH_MOBILE_SDHI_IRQ_SDCARD),
    DEFINE_RES_IRQ_NAMED(gic_iid(307), SH_MOBILE_SDHI_IRQ_SDIO),
};

static const struct platform_device_info sdhi1_info __initconst = {
    .name = "sh_mobile_sdhi",
    .id = 1,
    .res = sdhi1_resources,
    .num_res = ARRAY_SIZE(sdhi1_resources),
    .data = &sdhi1_pdata,
    .size_data = sizeof(sdhi1_pdata),
    .dma_mask = DMA_BIT_MASK(32),
};

TI's example device tree entry that works with their latest driver looks like this:

&mmc2 {
    status = "okay";
    vmmc-supply = <&wlan_en_reg>;
    bus-width = <4>;
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&mmc2_pins &wlan_pins_default>;
    pinctrl-1 = <&mmc2_pins_sleep &wlan_pins_sleep>;
    ti,non-removable;
    ti,needs-special-hs-handling;
    cap-power-off-card;
    keep-power-in-suspend;

    #address-cells = <1>;
    #size-cells = <0>;
    wlcore: wlcore@0 {
        compatible = "ti,wl1835";
        reg = <2>;
        interrupt-parent = <&gpio0>;
        interrupts = <7 IRQ_TYPE_EDGE_RISING>;
    };
};

I tried to add the wlcore sub node to the RZA1 device tree like this in r7s72100.dtsi:

mmc0: mmc@e804e800 {

    status = "okay";
    wlcore: wlcore@0 {
        compatible = "ti,wl1835";
        reg = <2>;
        interrupt-parent = <&gic>;
        interrupts = <38 IRQ_TYPE_EDGE_RISING>;
    };

};

The driver code parses the device tree like this:

static int wlcore_probe_of(struct device *dev, int *irq, struct wlcore_platdev_data *pdev_data)
{

    // CUSTOM CUSTOMIZATION FOR DEBUGGING
    printk("WL18XX: wlcore_probe_of() - Probing OF now!\n");

    struct device_node *np = dev->of_node;

    // CUSTOM CUSTOMIZATION FOR DEBUGGING
    if ( !np ) {
        printk("WL18XX: wlcore_probe_of() - Do not have an np!\n");
    }
    else {
        printk("WL18XX: wlcore_probe_of() - Device node: %s [%s]\n",np->name,np->type);
    }

    // CUSTOM CUSTOMIZATION FOR DEBUGGING
    if (!np || !of_match_node(wlcore_sdio_of_match_table, np)) {
        printk("WL18XX: wlcore_probe_of() - Can't find node in device tree!\n");
        return -ENODATA;
    }
    else {
        // CUSTOM CUSTOMIZATION FOR DEBUGGING
        printk("WL18XX: wlcore_probe_of() - Found node in device tree!\n");
    }

    *irq = irq_of_parse_and_map(np, 0);
    if (!*irq) {
        dev_err(dev, "No irq in platform data\n");
        kfree(pdev_data);
        return -EINVAL;
    }

    /* optional clock frequency params */
    of_property_read_u32(np, "ref-clock-frequency",
    &pdev_data->ref_clock_freq);
    of_property_read_u32(np, "tcxo-clock-frequency",
    &pdev_data->tcxo_clock_freq);

    return 0;

}

static int wl1271_probe(struct sdio_func *func,

const struct sdio_device_id *id)
{

    // CUSTOM CUSTOMIZATION FOR DEBUGGING
    printk("WL18XX: wl1271_probe() - Probing WILINK now!\n");

    struct wlcore_platdev_data pdev_data;
    struct wl12xx_sdio_glue *glue;
    struct resource res[1];
    mmc_pm_flag_t mmcflags;
    int ret = -ENOMEM;
    int irq;
    const char *chip_family;

    /* We are only able to handle the wlan function */
    if (func->num != 0x02)
        return -ENODEV;

    memset(&pdev_data, 0x00, sizeof(pdev_data));
    pdev_data.if_ops = &sdio_ops;

    glue = kzalloc(sizeof(*glue), GFP_KERNEL);
    if (!glue) {
        dev_err(&func->dev, "can't allocate glue\n");
        goto out;
    }

    glue->dev = &func->dev;

    /* Grab access to FN0 for ELP reg. */
    func->card->quirks |= MMC_QUIRK_LENIENT_FN0;

    /* Use block mode for transferring over one block size of data */
    func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;

    ret = wlcore_probe_of(&func->dev, &irq, &pdev_data);
    if (ret)
        goto out_free_glue; <---------- IT ALWAYS FAILS HERE

But when I load the modules, it can never find the appropriate node in the device tree:

Loading modules backported from Linux version R8.7_SP1-0-g13c25bc
Backport generated by backports.git R8.7_SP1-0-gd4777ef
WL18XX: wl1271_probe() - Probing WILINK now!
WL18XX: wl1271_probe() - Probing WILINK now!
WL18XX: wlcore_probe_of() - Probing OF now!
WL18XX: wlcore_probe_of() - Do not have an np!
WL18XX: wlcore_probe_of() - Can't find node in device tree!
wl1271_sdio: probe of mmc0:0001:2 failed with error -61

How can I get this to work - to find the SD Card node from the device tree? Thanks.

RE: RZ/A1 RSK Device Tree add WiFi/BT using SDIO interface with TI Wilink8

$
0
0

Thanks Chris - it turns out I needed to some code in the TI kernel driver to clear the interrupt for the Renesas in the TI wl18xx.ko interrupt handler code... This at least allows the WiFi module to talk with the RZA1 and not get a flood of interrupts. I can scan wireless networks with this fix but cannot associate... I'm thinking there might be some other place I need to put this.

Is this the right way to clear the interrupt?

///////////////////////////////////////////////////////////////////////////////

       void __iomem *irc1 = IOMEM(0xfcfef804);

       u16 value;

       value = __raw_readw(irc1);

printk("<cmp> 1 WILINK8 IRQ: Read this value: %d\n",value);

value = 0x0000;

printk("<cmp> 2 WILINK8 IRQ: Write this value: %d\n",value);

       __raw_writew(value, irc1);

value = __raw_readw(irc1);

printk("<cmp> 3 WILINK8 IRQ: Read this value: %d\n",value);

///////////////////////////////////////////////////////////////////////////////

RE: RZA1 RSK Adding Device Tree Node for MMC0

$
0
0

Thanks Chris - that is what I did. I removed the code that parsed the device tree and coded my IRQ to 38 and RISING edge. The driver now works.

RE: RZ/A1 RSK Device Tree add WiFi/BT using SDIO interface with TI Wilink8

$
0
0

Yes, writing a 0 to the IRQF bit in the IRQRR register is the correct way to cancel an interrupt.

Like you are doing above, the chip wants to first see the cpu READ that bit as a '1' before you can write a '0' to it.

so that

value = __raw_readw(irc1);

you have there is the correct procedure (READ...then WRITE). so don't take out that read when you go and clear up your debug code.

RE: RZA1 RSK Adding Device Tree Node for MMC0

$
0
0

Cool.

If you get all this working, maybe you can post a list of what you did so I (or someone else) could try it themselves if they want.

This chip seems to be getting popular for WiFi and BLE applications.


RE: RZ A1 M custom board SCIF with DMA

$
0
0

> Do any one of you have tried with success for using SCIF with DMA?

Unfortunately, I have not tried DMA with SCIF.

What baud rate are you running at?

I transfer files over serial all the time using ZMODEM and it works pretty good.

RE: RZA1H based board and starter kit LCD touchscreen on linux

$
0
0

It didn't work.

I don't know what to do :/

RE: RZ A1 M custom board SCIF with DMA

$
0
0

Hi Chris,

I am using 115200, but I am using ASCII to send file.

RE: RZ A1 M custom board SCIF with DMA

$
0
0

That is the same baud rate I am using.

Can you use ZMODEM? It will have flow control and error checking.

Look here:

 github.com/.../README.txt

and read see "Step 4. Download your application over the serial console"

RE: JPEG Encoding Library for Gstreamer on RSK RZA1H

$
0
0

In the v1.21 Linux BSP, the source code is located under rskrza1_bsp/librzjpeg/

This sample code adds HW support to the libjpeg library.

Unfortunately, this is only for decode, not encode.

Viewing all 1583 articles
Browse latest View live