Giter Site home page Giter Site logo

SMP and IPI for ESP32-S3 about linux-xtensa HOT 21 CLOSED

zap8600 avatar zap8600 commented on June 15, 2024
SMP and IPI for ESP32-S3

from linux-xtensa.

Comments (21)

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024 1

How about this?

How about just building your kernel with this dts and checking how it works?

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

So how can we find the node to add to the device tree? Are there any ESP-IDF functions we can use to find it?

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

So how can we find the node to add to the device tree?

I'm not sure I understand the question. We need to just literally add a node to the esp32s3.dts. It should have the compatible property that would match a device driver that must be written to control it and the reg property that would point to the right registers.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

I'm not sure I understand the question. We need to just literally add a node to the esp32s3.dts. It should have the compatible property that would match a device driver that must be written to control it and the reg property that would point to the right registers.

What sort of node are we looking for? Can we use ESP-IDF functions to find the node and its details? Is there a DTS in the ESP-IDF we could look at? Where in the DTS would we put the node?

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

Can we use ESP-IDF functions to find the node and its details?

I don't think so.

Is there a DTS in the ESP-IDF we could look at?

No.

What sort of node are we looking for? Where in the DTS would we put the node?

I'd suggest starting with the specification and then looking at other dts files in the linux kernel tree.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

I'd suggest starting with the specification and then looking at other dts files in the linux kernel tree.

Here is what I think is right so far.

cpu_0 {
    reg = <0x600C0000 0x30>;
};

I was unsure what to name it. I believe this would go under soc in the DTS. I still need to find what compatible should be. Anything else I need to do?

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

reg = <0x600C0000 0x30>

That covers some unrelated registers and doesn't cover any IPI registers. Perhaps it should be split into multiple regions.

I was unsure what to name it.

Normally it should be name@base_address, e.g.: ipi@600c0000.

I believe this would go under soc in the DTS.

Yes, that sounds right.

I still need to find what compatible should be

It needs to be specific enough to indicate what hardware it is for, but otherwise it's up to you.

Anything else I need to do?

The driver that would service this device and interact with the SMP guts of the xtensa linux kernel.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

That covers some unrelated registers and doesn't cover any IPI registers. Perhaps it should be split into multiple regions.

My bad. I thought it was what I should put for SYSTEM_CPU_INTR_FROM_CPU_0_REG.

It needs to be specific enough to indicate what hardware it is for, but otherwise it's up to you.

Would something like compatible = "esp,esp32s3-ipi"; work?

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

I thought it was what I should put for SYSTEM_CPU_INTR_FROM_CPU_0_REG.

The format of reg property is <base_address_cells size_cells …>, with more base/size pairs in the place of … if necessary to represent multiple regions. E.g. to cover the SYSTEM_CPU_INTR_FROM_CPU_0_REG alone it would be <0x600c0030 4>

Would something like compatible = "esp,esp32s3-ipi"; work?

Yes.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

The format of reg property is <base_address_cells size_cells …>, with more base/size pairs in the place of … if necessary to represent multiple regions. E.g. to cover the SYSTEM_CPU_INTR_FROM_CPU_0_REG alone it would be <0x600c0030 4>

So would this work?

ipi: ipi@600c0000 {
    compatible = "esp,esp32s3-ipi";
    cpu_0 {
        reg = <0x34 0x38>;
    };
    cpu_1 {
        reg = <0x38 0x3c>;
    };
};

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

So would this work?

Nope. It has wrong sizes and it implies certain address translation which is not set up here. Please read the DTS spec for the details.
Again, to cover the SYSTEM_CPU_INTR_FROM_CPU_0_REG alone the reg would be <0x600c0030 4>.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

Nope. It has wrong sizes and it implies certain address translation which is not set up here. Please read the DTS spec for the details. Again, to cover the SYSTEM_CPU_INTR_FROM_CPU_0_REG alone the reg would be <0x600c0030 4>.

How about this?

ipi: ipi@600c0000 {
    compatible = "esp,esp32s3-ipi";
    cpu0@30 {
        reg = <0x0 0x4>;
    };
    cpu1@34 {
        reg = <0x34 0x4>;
    };
};

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

How about just building your kernel with this dts and checking how it works?

Do I need to add another cpu to cpus first?

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

Do I need to add another cpu to cpus first?

It doesn't matter: there's no code that would interpret this information.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

It doesn't matter: there's no code that would interpret this information.

Alright. Will the build fail if my DTS is invalid?

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

Will the build fail if my DTS is invalid?

Depends on how invalid. Syntactically invalid dts will break the build, yes. Semantically inconsistent may cause dtc to print warnings. Otherwise you'll see issues at runtime.

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

I've been messing with my PC for hours trying to get it to build the base kernel. I'll leave my kernel and rootfs here in case anyone needs it. Now I have to build the kernel with my DTS.
esp32s3linux.zip

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

I'm going to delay this for now. I'm waiting on some hardware to arrive. I have an off-topic question though. Would it be possible to wire an SD Card to the board (over either SDIO or SPI), and then give Linux access to it? I just want to know if it's possible. If it is then I'll look into implementing it later.

from linux-xtensa.

jcmvbkbc avatar jcmvbkbc commented on June 15, 2024

Would it be possible to wire an SD Card to the board (over either SDIO or SPI), and then give Linux access to it?

It should be. I don't see why it shouldn't be possible.

from linux-xtensa.

raspiduino avatar raspiduino commented on June 15, 2024

Would it be possible to wire an SD Card to the board (over either SDIO or SPI), and then give Linux access to it?

It should be. I don't see why it shouldn't be possible.

Then it should be perfect for esp32 cam module

from linux-xtensa.

zap8600 avatar zap8600 commented on June 15, 2024

I'm going to close this for now. I think I should start with a less complex part of the chip to implement, like GPIO or SPI. I'll create an issue for questions on how I should implement these once I get to it.

from linux-xtensa.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.