Jump to content

martinayotte

Members
  • Posts

    3892
  • Joined

  • Last visited

Posts posted by martinayotte

  1. First, from what I'm aware, only Mainline kernel support SPI-NOR, so Legacy won't work.

    Second, the clock on the chip is only present during transactions and idle the rest of the time, so connecting an oscilloscope is a bit useless since during boot the only transaction happening is the JEDEC ID query which last only few microseconds.

    Third, DTS is only use in Mainline. Legacy is using FEX, but again no SPI-NOR support in Legacy.

  2. You don't need to do all this since nightly builds already provides SPI-NOR support. The only thing you have to do is changing the partitions sizes in the current DT :

     

     

     

                    spi@01c68000 {
                            compatible = "allwinner,sun8i-h3-spi";
                            reg = <0x1c68000 0x1000>;    
                            interrupts = <0x0 0x41 0x4>;
                            clocks = <0x2 0x1e 0x2 0x52>;
                            clock-names = "ahb", "mod";  
                            dmas = <0x19 0x17 0x19 0x17>;
                            dma-names = "rx", "tx";   
                            pinctrl-names = "default";
                            pinctrl-0 = <0x1a>;
                            resets = <0x2 0xf>;
                            status = "okay";
                            #address-cells = <0x1>;
                            #size-cells = <0x0>;   
                            linux,phandle = <0x4c>;
                            phandle = <0x4c>;

                            spi-flash@0 {
                                    #address-cells = <0x1>;
                                    #size-cells = <0x0>;
                                    compatible = "jedec,spi-nor";
                                    reg = <0x0>;
                                    spi-max-frequency = <0x989680>;
                                    status = "okay";

                                    partitions {
                                            compatible = "fixed-partitions";
                                            #address-cells = <0x1>;
                                            #size-cells = <0x1>;

                                            partition@0 {
                                                    label = "uboot";
                                                    reg = <0x0 0x100000>;
                                            };

                                            partition@100000 {
                                                    label = "env";
                                                    reg = <0x100000 0x100000>;
                                            };

                                            partition@200000 {
                                                    label = "data";
                                                    reg = <0x200000 0x200000>;
                                            };
                                    };
                            };
                    };

     

     

     

    You will see the MTD partitions by doing "cat /proc/mtd", and you can use flashcp from mtd-utils to write to /dev/mtd0.

  3. For UARTs, you don't need those library, you only need to access kernel serial device, such /dev/ttyS1, using python-serial.

     

    For example, the following piece of code will print any character received on RX :

    import serial
    
    serport = serial.Serial("/dev/ttyS1", 115200, timeout=1)
    while True:
        while serport.inWaiting() > 0:
            c = serport.read()
            print c
    
  4. There are many ways. Some more complex than others.

    The simplest on is running a startup script and call it in /etc/rc.local :

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    /root/my-startup-script.sh &
    
    exit 0
    
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines