8000 BBC HiFive Inventor board ported to Tock by mateibarbu19 · Pull Request #3225 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BBC HiFive Inventor board ported to Tock #3225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 22, 2022

Conversation

mateibarbu19
Copy link
Contributor

Pull Request Overview

This pull request aims to port Tock to the BBC HiFive Inventor board.

The source is mostly copied from the SiFive HiFive1 Rev B board.

I followed an earlier attempt, made by @TeodoraMiu, who tried to:

  • increased ram size in layout.ld
  • decreased baudrate for the serial interface

However the problems noticed with the UART speed were caused by a lack of configuration of the internal frequency. This was solved by merge #3215. (The code is also commited here.)

Still there were some bugs in the original sifive crate. When trying to clear all pending PL-interrupts a read-only register is overwritten.
The manual states another way to clear interrupts, by reading the claim register and writing the (or a) value back. See this commit.

The new HiFive board featured a different chip which didn't use the same indexing of interrupt numbers. So implementing a different InterruptService for each chip was necessary. So the e310x chip implementation was split in two, e310_g002 and e310_g003, which handle each interrupt number differently.

I also added the second UART peripheral in order to disable any unwanted interrupts from it.

Testing Strategy

This pull request was tested by checking the serial output of the
hifive_inventor target and the hifive1 qemu simulation.

Help Wanted

This pull request still needs to be physically tested on a hifive1 board.

@gemarcano could you please do this?

Documentation Updated

  • boards/README.md
  • boards/hifive_inventor/README.md
  • chips/e310_g002/README.md
  • chips/e310_g003/README.md

Formatting

  • Ran make prepush.

@mateibarbu19 mateibarbu19 changed the title Hifive inventor saved Hifive Inventor board ported to Tock Sep 17, 2022
@mateibarbu19 mateibarbu19 changed the title Hifive Inventor board ported to Tock BBC HiFive Inventor board ported to Tock Sep 17, 2022
Comment on lines +3 to +4
#![allow(dead_code)]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#![allow(dead_code)]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because not all interrupts are treated in service_interrupt() removing that line would result in useless warnings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps then make these pub(crate)? I removed the allow from g002 and didn't get any warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I removed the pub in lib.rs I got the something like: warning: constant is never used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are referring deleting pub from pub mod interrupts;

@gemarcano
Copy link
Contributor

I've built and run Tock on my HiFive1 RevB, and it appears to be working fine. UART works, I can load applications. Haven't tested it any more extensively than that, though.

bradjc
bradjc previously approved these changes Sep 20, 2022
@bradjc bradjc added the last-call Final review period for a pull request. label Sep 20, 2022
@mateibarbu19
Copy link
Contributor Author

@bradjc I have now tested myself the hifive1 board implementation on QEMU and didn't observe the bug mentioned two years ago. I am thinking of removing the comment from the hifive1 board (and the hifive_inventor where I forgot to delete it). Is that okay with you?

@bradjc
Copy link
Contributor
bradjc commented Sep 20, 2022

@bradjc I have now tested myself the hifive1 board implementation on QEMU and didn't observe the bug mentioned two years ago. I am thinking of removing the comment from the hifive1 board (and the hifive_inventor where I forgot to delete it). Is that okay with you?

That seems fine with me.

@mateibarbu19
Copy link
Contributor Author

Thanks. I just removed it.

@bradjc
Copy link
Contributor
bradjc commented Sep 22, 2022

bors r+

@bors
Copy link
Contributor
bors bot commented Sep 22, 2022

@bors bors bot merged commit a59a642 into tock:master Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
last-call Final review period for a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0