[video member=miotatsu stream_platform=twitch project=riscy title="Studying GPIO & The Config String" vod_platform=youtube id=LS_pE0zp4gs annotator=Miblo]
[0:08][Recap some off-stream work looking for the definition of __start()[ref
    title="ISO/IEC 9899:201x"
    url=http://open-std.org/JTC1/SC22/WG14/www/docs/n1570.pdf]]
[1:38][Recap what we discovered about handle_m_time_interrupt() last time][:research]
[3:59][TODO: Dive into __start + entry.S][:blackboard]
[5:05][Set the stage for the day]
[6:13][@hossein1387][I had a look at link.lds (located at freedom-e-sdk/bsp/env/freedom-e300-hifive1 which provides stack size and other stuff) but it does call _start]
[6:54][Consult link.lds][:research]
[8:44][Come to understand handle_m_ext_interrupt()[ref
    site="RISC-V"
    page="Draft Privileged ISA Specification v1.9.1"
    url=https://riscv.org/specifications/privileged-isa/]][:research]
[15:59][:Research the GPIO[ref
        site="SiFive Developers"
        page="Platform Reference Manual"
        url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]]
[17:24][Consult the GPIO pin layout[ref
    site="SiFive Developers"
    page="Freedom E310-G000 Manual"
    url=https://www.sifive.com/documentation/chips/freedom-e310-g000-manual/]][:research]
[19:31][Determine to understand the GPIO_REG macro][:research]
[21:37][Point out the GPIO pins on the HiFive1][:hardware]
[23:10][Continue reading env/hifive1.h][:research]
[25:05][Find the GPIO_REG() and _REG32() macros in env/freedom-e300-hifive1/platform.h][:research]
[27:09][Read about the General Purpose Input/Output Controller (GPIO)[ref
    site="SiFive Developers"
    page="Freedom E310-G000 Manual"
    url=https://www.sifive.com/documentation/chips/freedom-e310-g000-manual/]][:research]
[29:47][Read the Machine Configuration Description[ref
    site="RISC-V"
    page="Draft Privileged ISA Specification v1.9.1"
    url=https://riscv.org/specifications/privileged-isa/]][:research]
[37:28][@hossein1387][From what I know, device tree is the way to tell Linux / OS what hardware we are using]
[38:12][Read about Device Tree[ref
    site="Embedded Linux Wiki"
    page="Device Tree Usage"
    url=http://elinux.org/Device_Tree_Usage]][:research]
[43:41][Continue reading about the Configuration String[ref
    site="RISC-V"
    page="Draft Privileged ISA Specification v1.9.1"
    url=https://riscv.org/specifications/privileged-isa/]][:research]
[45:18][Consult the table detailing the overall memory map of the E3 Coreplex[ref
            site="SiFive Developers"
            page="E3 Coreplex Manual"
            url=https://static.dev.sifive.com/pdfjs/web/viewer.html?file=https://static.dev.sifive.com/SiFive-E3-Coreplex-v1.2.pdf]]
[45:55][Enable print_instructions() to print the information following the configuration string address]
[51:13][Continue studying the GPIO[ref
        site="SiFive Developers"
        page="Platform Reference Manual"
        url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]][:research]
[54:21][Using XOR to invert][:blackboard]
[56:57][Briefly consult the diagram detailing the structure of a single GPIO Pin with Control Registers before reading on about the GPIO[ref
        site="SiFive Developers"
        page="Platform Reference Manual"
        url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]][:hardware :research]
[1:01:56][GPIO][:blackboard]
[1:03:52][We are out of time for today]
[1:05:32][@hossein1387][I tried to print the config]
[1:05:53][@hossein1387][It didn't work out]
[1:06:33][@hossein1387][It's all garbage]
[1:07:01][@hossein1387][{ model = "SiFive,FE310G-0000-Z0"; compatible = "sifive,fe300"; /include/ 0x20004;};]
[1:08:42][@hossein1387][Can you also try? I want to know if there is a serial number or something]
[1:09:11][Wind it down]
[/video]
