Jump to content

Zeiss

Members
  • Posts

    10
  • Joined

  • Last visited

  1. Seems to be so. Okay, I try to explain it. Yes, I'm writing my own LKM for this chip. It is possible to "reference" pins directly in the section, like this: os8104: os8104@41 { compatible = "smsc,os8104"; reg = <0x41>; master = <0>; /* slave mode*/ bypass = <0>; /* /ABY (all bypass mode) im register bXCR */ reset-gpios = <&pio 8 17 0>; /* PI17 */ int-gpios = <&pio 8 16 0>; /* PI16 */ aint-gpios = <&pio 8 19 0>; /* PI19 */ error-gpios = <&pio 8 18 0>; /* PI18 */ 3db-gpios = <&pio 8 20 0>; /* PI20 */ }; To get access to those pins (PI 17, PI 19 and so one), just do: devm_gpiod_get (&client->dev, "reset", GPIOD_OUT_HIGH); This means "give me the pin named reset and initialize them as output with logic 1", the third parameter is optional and can be done later by calling gpiod_direction_output() (check include/linux/gpio/consumer.h for this). I would like to do the same, but throw pinctrl, so configure the GPIOs in pinctrl section and reference them from chip section, like in example in first post. Why? In rockchip dtbs it seems to be the way.
  2. OS8104 is a network IC for MOST bus, but it doesn't matter.... this is a fundamental question. It is possibile to reference the pins directly in device section or go throw pinctrl section. In first case te pins are accessible by devm_gpiod_get (...). But how can I do this, if a go throw pinctrl? And www.mein-bmw-rudel.de (or www.bmw-rudel.de) is my homepage
  3. Hello guys, hope I'm in the right subforum. If not, please postpone. I have a question about the device tree and pinctrl... I have added a chip to my I2C-0, the configuration looks like this: &i2c0 { clock-frequency = <400000>; status = "okay"; os8104: os8104@41 { compatible = "smsc,os8104"; reg = <0x41>; master = <0>; /* slave mode*/ bypass = <0>; /* /ABY (all bypass mode) im register bXCR */ pinctrl-names = "default"; pinctrl-0 = <&os8104_reset &os8104_int &os8104_aint &os8104_error &os8104_3dB>; }; }; Then, under pinctrl I have added this block: &pinctrl { ir { ir_int: ir-int { rockchip,pins = <2 2 RK_FUNC_GPIO &pcfg_pull_none>; }; }; ... os8104 { os8104_reset: os8104-reset { rockchip,pins = <RK_GPIO2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>; }; os8104_int: os8104-int { rockchip,pins = <RK_GPIO3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>; }; os8104_aint: os8104-aint { rockchip,pins = <RK_GPIO3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; }; os8104_error: os8104-error { rockchip,pins = <RK_GPIO3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_down>; }; os8104_3dB: os8104-3dB { rockchip,pins = <RK_GPIO3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>; }; }; }; But, how can I access these pins from the LKM? I'm using of_find_node_by_name to find the device node. Board is Rock64 and kernel is 4.4.143 Many thanks.
  4. Good evening, I have a Rock64/4G board and just downloaded and installed the Armbian_5.42_Rock64_Debian_stretch_default_4.4.124_desktop.7z to the SD card. After the reboot I saw X11 login interface and everything was great. After that I installed the latest packages with an apt update and then apt upgrade and restarted. Now I only see "rock64 login:" on the screen. The Xorg.0.log I have attached looks actually quite good. Xorg.0.log
  5. Here some more infos. boot.cmd: setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait panic=10 setenv video-mode sunxi:1024x768-24@60,monitor=composite-pal,hpd=0,edid=0,overscan_x=32,overscan_y=20 setenv stdout serial,vga setenv stderr serial,vga load mmc 0:1 0x43000000 ${fdtfile} || load mmc 0:1 0x43000000 boot/${fdtfile} load mmc 0:1 0x42000000 zImage || load mmc 0:1 0x42000000 boot/zImage bootz 0x42000000 - 0x43000000 Output in U-Boot: Printenv in U-Boot:
  6. Hello together, I'm trying to activate composite output on my BananaPRO. First of all, I've added setenv command to my boot.cmd: setenv video-mode sunxi:1024x768-24@60,monitor=composite-pal,hpd=0,edid=0,overscan_x=32,overscan_y=20 then mkimage -C none -A arm -T script -d boot.cmd boot.scr copied boot.scr to sd-card and reboot. In u-boot I see: but my monitor (DELL 2007FP with composite input) and my TV (Panasonic Plasma) are still black. Any ideas? Thanks!
  7. Oh men.... this was my mistake :( After correction in dmesg: And cat /proc/interrupts: It's looking pretty good. Thank you very much!
  8. So, I've checked them. My DT after change: &i2c2 { pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins_a>; status = "okay"; os8104: os8104@41 { compatible = "smsc,os8104"; reg = <0x41>; master = <0>; bypass = <1>; reset_gpios = <&pio 8 17 0>; /* PI17 */ int_gpios = <&pio 8 16 0>; /* PI16 */ aint_gpios = <&pio 8 19 0>; /* PI19 */ error_gpios = <&pio 8 18 0>; /* PI18 */ }; }; And corresponding code: static int os8104_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device_node *dn; int rc = 0; u32 val; priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); if (!priv) { return -ENOMEM; } dn = of_find_node_by_name(NULL, os8104_driver.driver.name); if (dn == NULL) { printk(KERN_ERR "Node not found! \n"); return -ENODEV; } rc = of_property_read_u32(dn, "master", &val); if (rc < 0) { printk(KERN_ERR "Property master not found!\n"); return -ENODEV; } else { priv->master = val; } printk(KERN_INFO "Value of property master is: %d\n", priv->master); rc = of_property_read_u32(dn, "bypass", &val); if (rc < 0) { printk(KERN_ERR "Property bypass not found!\n"); return -ENODEV; } else { priv->bypass = val; } printk(KERN_INFO "Value of property bypass is: %d\n", priv->bypass); priv->adapter = to_i2c_adapter(client->dev.parent); priv->client = client; priv->reset_gpios = devm_gpiod_get (&client->dev, "reset_gpios", GPIOD_OUT_HIGH); if (IS_ERR(priv->reset_gpios)) { dev_err(&client->dev, "%s ERROR: Can't get RESET GPIO\n",__func__); return PTR_ERR(priv->reset_gpios); } return 0; } After insmod ./os8104.ko dmesg says: The error is still there. And here some additional debugging: os8104-node is there: root@banana:/sys# find ./ -name os8104* ./firmware/devicetree/base/soc@01c00000/i2c@01c2b400/os8104@41 root@banana:/sys# The gpios defined inside of them too: root@banana:/sys/firmware/devicetree/base/soc@01c00000/i2c@01c2b400/os8104@41# ls -la total 0 drwxr-xr-x 2 root root 0 May 15 17:57 . drwxr-xr-x 3 root root 0 May 15 17:57 .. -r--r--r-- 1 root root 16 May 15 17:59 aint_gpios -r--r--r-- 1 root root 4 May 15 17:59 bypass -r--r--r-- 1 root root 12 May 15 17:59 compatible -r--r--r-- 1 root root 16 May 15 17:59 error_gpios -r--r--r-- 1 root root 16 May 15 17:59 int_gpios -r--r--r-- 1 root root 4 May 15 17:59 master -r--r--r-- 1 root root 7 May 15 17:59 name -r--r--r-- 1 root root 4 May 15 17:59 reg -r--r--r-- 1 root root 16 May 15 17:59 reset_gpios root@banana:/sys/firmware/devicetree/base/soc@01c00000/i2c@01c2b400/os8104@41#
  9. Many thanks SoC during development is an A20. Okay, I'll change my DT and check this after that. Interrupts: sure, I'll test this too, it's just for "quick and dirty" test.There is just one interrupt, for INT_GPIOS pin, the other pins are just "look and check" pins.
  10. Hello together, I'm developing a device driver for a network interface controller for MOST bus. So, first of all, I've added a node with all the settings for this IC in my DTS, the IC is connected to second I²C-controller: &i2c2 { pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins_a>; status = "okay"; os8104: os8104@41 { compatible = "smsc,os8104"; reg = <0x41>; master = <0>; /* slave mode*/ bypass = <0>; /* /ABY (all bypass mode) im register bXCR */ reset_gpios = <&pio 8 17>; /* PI17 */ int_gpios = <&pio 8 16>; /* PI16 */ aint_gpios = <&pio 8 19>; /* PI19 */ error_gpios = <&pio 8 18>; /* PI18 */ }; }; The has got a couple of pins, which are indicating the status of bus and control the IC (i.e. /reset-pin), so I've connected them to PI16 - PI19. Here is the probe function in my LKM: static int os8104_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device_node *dn; int rc = 0; u8 val; struct os8104 *priv; int irq; priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); if (!priv) { return -ENOMEM; } dn = of_find_node_by_name(NULL, os8104_driver.driver.name); if (dn == NULL) { printk(KERN_ERR "Node not found! \n"); return -ENODEV; } rc = of_property_read_u8(dn, "master", &val); if (rc < 0) { printk(KERN_ERR "Property master not found!\n"); return -ENODEV; } else { priv->master = val; } rc = of_property_read_u8(dn, "bypass", &val); if (rc < 0) { printk(KERN_ERR "Property bypass not found!\n"); return -ENODEV; } else { priv->bypass = val; } priv->adapter = to_i2c_adapter(client->dev.parent); priv->client = client; priv->reset_gpios = devm_gpiod_get (&client->dev, "reset_gpios", GPIOD_OUT_HIGH); priv->int_gpios = devm_gpiod_get (&client->dev, "int_gpios", GPIOD_IN); priv->aint_gpios = devm_gpiod_get (&client->dev, "aint_gpios", GPIOD_IN); priv->error_gpios = devm_gpiod_get (&client->dev, "error_gpios", GPIOD_IN); irq = gpiod_to_irq (priv->int_gpios); return 0; } Ok, my problem is/are the four devm_gpiod_get (....), the functions returning -2, that means not found. Any idea, what is going wrong? Kernel version is 4.14.39 and SBC is a BananaPRO (Allwinner A20). Many thanks
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines