| Deutsch English Français Italiano |
|
<vf5sit$2gjqb$1@paganini.bofh.team> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: antispam@fricas.org (Waldek Hebisch)
Newsgroups: comp.lang.forth
Subject: Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)
Date: Mon, 21 Oct 2024 15:39:11 -0000 (UTC)
Organization: To protect and to server
Message-ID: <vf5sit$2gjqb$1@paganini.bofh.team>
References: <87frpoewse.fsf@nightsong.com> <vetqgo$1k6sl$1@paganini.bofh.team> <nnd$1b4bff72$2d921b40@6cc2be919654136f> <vf5a40$2fkdi$1@paganini.bofh.team> <nnd$3d8918a3$47abdf13@03dd132c1b0f3b13>
Injection-Date: Mon, 21 Oct 2024 15:39:11 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="2641739"; posting-host="WwiNTD3IIceGeoS5hCc4+A.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.9.3
Bytes: 3075
Lines: 57
albert@spenarnc.xs4all.nl wrote:
> In article <vf5a40$2fkdi$1@paganini.bofh.team>,
> Waldek Hebisch <antispam@fricas.org> wrote:
> <SNIP>
>>
>>RISCV ciforth beta 2023Mar30
>>MMAP-IO
>> OK
>>HEX
>> OK
>>VMA-IO @ .
>>B2000000 OK
>>DEV-MEM @ .
>>3 OK
>>
> Encouraging.
>
>>Datasheet says that device address space starts at 0x01000000
>>and ends at 0x7FFFFFFF (above is DRAM). There is a command
>>line utility to do I/O. Sending 0x01000000 to 0x03022000 turns on
>>blue LED, sending 0x0 truns it off. AFAICS in lina corresponding
>>address is B2022000. More generally, there are four GPIO devices
>>(ports). Port 0 is at 0x03020000, port 1 at 0x03021000, port 2 at
>>0x03022000, port 3 at 0x03023000. Device access should be done in
>>32-bit units.
>
> This suggest that you can do the same from lina using virtual
> addresses B302x000 . That is vma-io + 0x0100,0000 (device start) + 2x000.
> You probably have to initialize the ports to output in some way
> for this to work.
I tried first things like above and got segfaults. AFAICS lina B2000000
corresponds to 0x3000000 in device space, so 0x03022000 corresponds to
B2022000. It seems that lina did not map block between 0x1000000
and 0x3000000, in this block that are 'ap_mailbox' and 'ap_system_ctrl',
it is probably not wise to mess with them from user space.
> All io must be accessed with 32 bit. lina provides L! L@ for
> this. (My conventions is B-W-L-Q ).
1000000 B2022000 L!
OK
0 B2022000 L!
OK
blinks the LED. I tried and 64-bit access works too, but it reads
or writes also the second register, so L! and L@ are simpler to use.
I still need to check which GPIO-s are actually usable, there is
4*32 = 128 logical lines, but the 64-Mb chip has only 68 pins.
There are several control registers deciding what pins do:
PINMUX, RTCSYS_GPIO and control registers for GPIO device.
LED was configured for GPIO output by bundled software, so
it was enough to write to the data port.
--
Waldek Hebisch