Home » RBC Forums » General Discussion » CB030, A 68030 SBC for hobbyists
Re: CB030, A 68030 SBC for hobbyists [message #7157 is a reply to message #7154] |
Tue, 03 March 2020 07:17   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
mikemac wrote on Mon, 02 March 2020 22:53
Copying B: to the PC and then back to a new B: using gkermit sounds like an overnight job. :
Is copying A: to a new B: enough to verify the CF to be working? IE the CF that don't work would be detected by such an exercise?
Mike,
Copying A: to new B: with verify flag is a reliable way of checking the compatibility of new CF disk. The command is:
pip b:=a:*.*[v]
gkermit is quite fast transfer a few files between PC and CB030. Transfer the entire CP/M68K distribution files take about 40 minutes.
I'm working on improving the CF interface. I'm quite optimistic that I've found the solution. It has to do with the tail end of the CF access where CF read/write needs to be negated first before CF chip select negates. With that fix, I'm able to read/write many brands of CF including the 2G Verbatim disk. So far every CF disk I tried has worked. Unfortunately this requires a CPLD change; do you have an Altera CPLD programmer? If not, I'll ship you another CB030 with the CPLD fix after I've done a few days of testing.
Bill
PS, your current SanDisk 256meg CF disk should work just fine without the CPLD fix. It is a blazing fast disk that can handle the lack of hold time at the end of a CF access.
[Updated on: Tue, 03 March 2020 07:23] Report message to a moderator
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7158 is a reply to message #7157] |
Tue, 03 March 2020 07:28   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
I have a Terasic Blaster 3" from my keyboard as I type hooked up to a Altera MAX10 dev board.
And I have these versions of Quartus available on my machine:
Mercury=>ls /opt/Quartus/
total 28
drwxrwxr-x 6 mikemac mikemac 4096 Mar 9 2017 12.0sp2
drwxr-xr-x 8 mikemac mikemac 4096 Apr 19 2017 13.0sp1
drwxrwxr-x 8 mikemac mikemac 4096 Mar 9 2017 13.1
drwxr-xr-x 10 root root 4096 Mar 9 2017 16.1
drwxrwxr-x 10 mikemac mikemac 4096 May 9 2017 17.0
drwxrwxr-x 10 mikemac mikemac 4096 Feb 17 2019 18.1
drwxr-xr-x 10 mikemac mikemac 4096 Jan 16 19:40 19.1
One of my longer term goals for the CB030 is to muck around with the CPLD's config. Just to see if I can really muck it up!
I have a Transcend 4G 133X CF card coming today. I'm looking at using one of the larger CF cards as the disk for Linux. It's obviously gross overkill for CPM. Speaking of which, I did 'dd' the B: drive to my Linux machine and back to an 8MB SanDisk card and it seems to work. CPM recognizes it and 'dir' works.
Mike
[Updated on: Tue, 03 March 2020 07:32] Report message to a moderator
|
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7166 is a reply to message #7160] |
Wed, 04 March 2020 19:05   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
A couple of questions:
1 - I don't see the connector for the "Discrete I/O Port" in the schematics. I assume it's the output port from the 68681 but the number of pins don't quite match.
2 - On the 68681, you used A1-A4 for RS1-4. That makes each register separated by an empty byte. Was there a reason for using A1-4 instead of the more traditional A0-A3?
I finally got the right USB cables [USB A extension cables is what works] today. My 64MB 72 pin SIMM is supposed to be here on Friday. I've been able to build the T030 kernel. Starting configuring a kernel for the CB030. The IDE and serial drivers will need to be written/modified for the board. And I've started sketching out a boot ROM. I'm going to start with minimal functionality in it with the hope that it might get merged into your ROM so more people can play too.
3 - Will ST39SF040 flash ROMs work on the board? They're 5V and pin compatible. I used them in my 68SEC000 board without a problem. [ROM problem that is. Plenty of other problems with that board!]
Mike
[Updated on: Wed, 04 March 2020 19:06] Report message to a moderator
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7167 is a reply to message #7166] |
Wed, 04 March 2020 19:30   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Mike,
Attached is the discrete I/O port definition. I'll put it in the CB030 homepage as well.
The A1-A4 for RS1-4 is a holdover from Tiny68K which is based on 68000 and does not have dynamic bus sizing capability. With 68020/30, I probably should've use A0-A3.
ST39F040 should work just fine. I am ordering a few of them as well. I happened to have several hundred AT49F040 in PLCC package, so that's why I used them the way I did.
Feel free to modify the ROM code as you see fit. What I have is chaotic, messy code and probably should be abandon all together.
Bill
[Updated on: Wed, 04 March 2020 19:34] Report message to a moderator
|
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7170 is a reply to message #7167] |
Thu, 05 March 2020 08:39   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
Thanks for the pinouts of the discrete I/O port.
One more question (for the moment):
4- Do you have any unused pins left on the 7128S? The CF/IDE interface doesn't have its IRQ signal attached to anything. I've never written a polling driver in Linux before. I don't know what issues will come up as a result.
5 - What are the IRQ assignments for the M68K? IRQ681! appears to be the only IQR on the system.
Mike
|
|
|
|
|
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7182 is a reply to message #7180] |
Thu, 05 March 2020 20:35   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
mikemac wrote on Thu, 05 March 2020 18:59Anyone ever use an Arduino or some such as an in circuit emulator of a 39F040 ROM? I've gotten spoiled by being able to update the firmware on one of my projects via JTAG. This physically prying the ROM out of the board, flashing (and verifying! it, and carefully putting it back it over and over is so 1980's! I'll probably dust off the M68K emulator for some of the initial boot loader work.
Mike,
AT49F040 can be programmed in-situ, so it should be possible to load the new ROM firmware in RAM to check it out and once the new ROM firmware is working correctly, it can be programmed into AT49F040 without removing it. I'm sure the same thing can be done with 39F040 as well.
I've done the in-situ programming of flash on the repurposed Soneplex MPU board, so let me see if I can port that code to CB030 in the next few days.
Bill
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7184 is a reply to message #7183] |
Thu, 05 March 2020 23:07   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
plasmo wrote on Thu, 05 March 2020 22:19mikemac wrote on Thu, 05 March 2020 09:39
4- Do you have any unused pins left on the 7128S? The CF/IDE interface doesn't have its IRQ signal attached to anything. I've never written a polling driver in Linux before. I don't know what issues will come up as a result.
Mike,
Returning to your original question about whether there are spare pins on CPLD for CF interrupt: yes, there are two spare pins; it is not difficult to wire CF interrupt to one of the spare pins; add a pull resistor; and modify the CPLD to add a level 2 autovector.
Bill
I'll probably hold off on adding anything for the CF IRQ until I get to that point and it proves necessary. Adding a wire to INTX is probably easier than soldering directly to the CPLD's pin. At least for me.
Mike
|
|
|
|
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7194 is a reply to message #7193] |
Fri, 06 March 2020 16:34   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
plasmo wrote on Fri, 06 March 2020 17:31Mike,
Can you see voltage regulators and 5V-to-3V buffers? Sometimes they use 3.3V memory parts but translate 5V to 3V.
Bill
There are 8 DRAM chips and one 3.3V regulator on the board. That's it.
Mike
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7196 is a reply to message #7195] |
Fri, 06 March 2020 19:18   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
plasmo wrote on Fri, 06 March 2020 18:09Ouch, that's no good. Looked up MT4LC16M4H9 and it is 3.3V part, not 5V tolerant. That was a 3.3V 64meg SIMM and probably not doing it any good plugging into a 5V system.
Bill
I'll give them a call tomorrow or Monday and see if they'll straighten it out. It's not the nine dollars as much as the missed opportunity of having it this weekend for pimping out my CB030 board. I can still make progress with the 16MB. Just disappointing.
Mike
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7197 is a reply to message #7196] |
Fri, 06 March 2020 20:06   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
This is a snippet of program to chip erase AT49F040 and copy program located in RAM 0x0-0x7FFFF to flash. It takes about 10 seconds to re-flash AT49F040.
Erase and reprogram the flash is the easy part, the trick is having the necessary functionalities to load & test an updated version of itself and re-flash the updated version of itself. I'll have the EPROM programmer as a backup just in case the program no longer able to update itself.
Bill
; chip erase
move.b #$aa,flash+$5555 ;chip erase command
move.b #$55,flash+$2AAA
move.b #$80,flash+$5555
move.b #$aa,flash+$5555
move.b #$55,flash+$2AAA
move.b #$10,flash+$5555
pollbit7:
btst.b #7,flash ;data polling bit 7
bne pollbit7
; now do byte programming
; copy RAM from 0x0 to 0x7FFFF to flash at 0xFE000000 to 0xFE07FFFF
lea 0,a0 ;point to RAM starting from 0x0
lea $fe000000,a1 ;point to beginning of flash
byteprog:
move.b #$aa,flash+$5555 ;byte programming command
move.b #$55,flash+$2AAA
move.b #$A0,flash+$5555
move.b (a0),(a1)
;data polling of bit 7
move.b (a0)+,d0
and.b #$80,d0 ;poll bit 7
pollb7:
move.b (a1),d1
and.b #$80,d1
cmp.b d0,d1
bne pollb7
add.l #1,a1 ;program next flash byte
cmp.l #$fe080000,a1 ;top of flash?
bne byteprog
rts ;return to calling program
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7230 is a reply to message #7196] |
Fri, 13 March 2020 14:43   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
mikemac wrote on Fri, 06 March 2020 20:18plasmo wrote on Fri, 06 March 2020 18:09Ouch, that's no good. Looked up MT4LC16M4H9 and it is 3.3V part, not 5V tolerant. That was a 3.3V 64meg SIMM and probably not doing it any good plugging into a 5V system.
Bill
I'll give them a call tomorrow or Monday and see if they'll straighten it out. It's not the nine dollars as much as the missed opportunity of having it this weekend for pimping out my CB030 board. I can still make progress with the 16MB. Just disappointing.
I called 18004memory up on Monday and they sent a replacement on Tuesday. They were really nice about it. I got it a few minutes ago and the board still boots! Yippee!!!
T030 ROM BIOS v2.11 (c) 2018 Tobias Rathje
CB030 version ported by Mike McDonald 2020
------------------------------------------
Build: Mar 13 2020 12:46:11
#> ?
? - Help
a - Load and execute EhBasic
b - Toggle heartbeat LED: b <val>
c - Modify cache register: c <val>
d - Dump address: d <addr>
e - Force exception: e <num>
h - Perform hardisk command - h? for help
i - Set interrupt level: i <level>
g - Run: g <addr>
l - Load linux: l <cmdline> <ramdisk start addr> <ramdisk size>
m - Mandelbrot test: m <count>
q - Perform RAM check: q <mode> <address> <size> <count>
r - Dump registers
v - Load and execute Test BIOS from SD card
u - Run in user mode: u <addr>
w - Write single byte: w <addr> <data>
x - Transfer file with XMODEM: x <addr>
z - Soft reset
<#> - Run script "#"
#>
Mike
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7240 is a reply to message #7231] |
Sat, 14 March 2020 15:39   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
If one use a "magic" CF card:
T030 ROM BIOS v2.11 (c) 2018 Tobias Rathje
CB030 version ported by Mike McDonald 2020
------------------------------------------
Build: Mar 14 2020 15:29:15
#> hl
Volume label: Linux
----A 2020/03/14 15:25 118 1.CMD
----A 2020/03/14 15:26 2814888 LINUX.BIN
D-H-- 2020/03/14 15:25 0 FSEVEN~1
2 File(s), 2815006 bytes total
1 Dir(s), 4874KiB free
#> 1
[ Load Linux image into RAM ]
0%_________________________________________100%
#################################################
2814888 bytes read
[ Starting Linux ]
Bootinfo address: 0x042b1000
Machine type: 13
Memory start: 0x04000000
Memory size: 64 MB
Loading Linux at 0x04001000
Exception #11 SR: 2704 PC: 04001004
#>
I know the load address and the memory start address are wrong. [They're for the T030 board.] But making some progress. A bit flakey at times but nothing fatal yet.
Mike
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7248 is a reply to message #7247] |
Sun, 15 March 2020 10:07   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
plasmo wrote on Sun, 15 March 2020 07:39Mike,
That's very cool. I hope you'll post the CF image and the firmware so I can try it as well.
Bill
Once I get Linux running and Tobias confirms I haven't broken the T030, I intend on making the code available on a RBC builder's page or at the minimum, my website. Probably both.
Mike
|
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7251 is a reply to message #7250] |
Sun, 15 March 2020 16:13   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
Getting closer:
T030 ROM BIOS v2.11 (c) 2018 Tobias Rathje
CB030 version ported by Mike McDonald 2020
------------------------------------------
Build: Mar 15 2020 10:53:20
#> 1
[ Load Linux image into RAM ]
0%_________________________________________100%
#################################################
2814856 bytes read
[ Starting Linux ]
Bootinfo address: 0x002b1000
Machine type: 14
Memory start: 0x00000000
Memory size: 16 MB
Loading Linux at 0x00001000
ABC3GHIJK
Linux version 4.9.156-CB030 (mikemac@Altair.mikemac.com) (gcc version 6.1.0 (GCC) ) #4 Sun Mar 15 16:01:06 MST 2020
bootconsole [cb030serial0] enabled
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4060
Kernel command line: root=/dev/hda2 rw console=ttyS0,38400n8 earlyprintk=ttyS0,38400
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Sorting __ex_table...
Memory: 13420K/16384K available (1863K kernel code, 270K rwdata, 544K rodata, 64K init, 125K bss, 2964K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0x0028175c - 0x00281b5c ( 1 KiB)
kmap : 0xd0000000 - 0xf0000000 ( 512 MiB)
vmalloc : 0x01800000 - 0xd0000000 (3304 MiB)
lowmem : 0x00000000 - 0x01000000 ( 16 MiB)
.init : 0x002a1000 - 0x002b1000 ( 64 KiB)
.text : 0x00001000 - 0x001d2d48 (1864 KiB)
.data : 0x001d5190 - 0x002a0bdc ( 815 KiB)
.bss : 0x00281680 - 0x002a0bdc ( 126 KiB)
NR_IRQS:200
unexpected interrupt from 256
unexpected interrupt from 256
unexpected interrupt from 256
...
Now I have to track down who is generating IRQ 256 and make them stop! 
Unfortunately my 64MB SIMM seems flaky. I have a lot of issues loading the 2.8MB Linux kernel when it's in the board. I haven't had any issue with the 16MB SIMM Bill sent with the board. So for now I'm limited to 16MB. Should be enough to boot and run BusyBox. Fingers crossed!
Mike
|
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7253 is a reply to message #7252] |
Sun, 15 March 2020 21:31   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
plasmo wrote on Sun, 15 March 2020 19:35Mike,
On the CB030 homepage are memory diagnostic for 16meg and 64meg DRAM. The 16meg DRAM test runs fairly fast, about 45 seconds per pass. The 64 meg test takes 4 times longer. You should see console messages like below.
Bill
I'm going to try testing the 64MB SIMM once I've updated the CPLD to your latest version. But that may be after I figure out who is triggering the IRQ 256. I think it's the 68681 timer left on from the boot loader. The 68681 UART is run mostly in PIO mode so it's probably not it. And I think those are the only two interrupts in the system. So hopefully it's one or the other.
Mike
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7258 is a reply to message #7253] |
Mon, 16 March 2020 06:59   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Mike,
The 68681 timer interrupt is turned on in iDUART routine which is called very early on by the monitor (it is the first subroutine called). Attached is the iDUART routine. You can see the timer is set to interrupt at 10mS which is the basic clock tick driving the wall clock and event clocks. The rotating 7-segment display is driven by the timer interrupt.
Bill
*
* initialize the DUART 68692, only lower byte is connected to data bus d0-d7
* interrupt is connected to PB8 of 68302, nIACK is tied to VCC, need manual service
* of interrupt
iDUART:
move.b #$13,MRA * write to MR1A as follow:
* no RxRTS, RxRDY int, Char error, no parity, 8 bits
move.b #$07,MRA * now write to MR2A as follow:
* normal, no TxRTS, no CTS, 1 stop
move.b #$0,IMRD * mask off interrupt
move.b #$81,IVRD * vector number 0x81 is where DUART ISR is located
move.b #0,OPCR * make output register general purpose
move.b #$ff,SETOPR * clear display
move.l #$20000,d0 * diagnostic, let it show for a while
iduartspin1:
sub.l #1,d0 * diagnostic
bne iduartspin1 * diagnostic
move.b #$de,CLROPR * drive the value '9' on a 7-seg display
move.b #$70,ACR * clear ACR[7] bit, timer mode, 16x prescaler
move.b #$80,CTLR * to get 10ms interrupt, timer preload value is 0x480
move.b #$4,CTUR
move.b #$CC,CSRA * 38.4K baud
move.b STOPCTR,d0 * read clear the interrupt bit associated with timer
move.b #$A,CRA * disable Chan A transmit and receive
bsr iduartspin8 * delay loop
move.b #$ff,SETOPR * clear display
move.b #$e,CLROPR * write '7'
bsr iduartspin8 * delay loop
move.b #$ff,SETOPR * clear display
move.b #$cc,CLROPR * write '4'
bsr iduartspin8 * delay loop
rts
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7259 is a reply to message #7258] |
Mon, 16 March 2020 08:57   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
plasmo wrote on Mon, 16 March 2020 06:59Mike,
The 68681 timer interrupt is turned on in iDUART routine which is called very early on by the monitor (it is the first subroutine called). Attached is the iDUART routine. You can see the timer is set to interrupt at 10mS which is the basic clock tick driving the wall clock and event clocks. The rotating 7-segment display is driven by the timer interrupt.
Bill
Remember, I'm running the T030 boot loader so it's a completely different code base. But it does essentially the same thing.
I think I'm just not registering the IRQ handler at the correct number in Linux. Hopefully I find out later today.
Mike
|
|
|
Re: CB030, A 68030 SBC for hobbyists [message #7265 is a reply to message #7253] |
Mon, 16 March 2020 21:29   |
mikemac
Messages: 250 Registered: March 2017
|
Senior Member |
|
|
mikemac wrote on Sun, 15 March 2020 21:31plasmo wrote on Sun, 15 March 2020 19:35Mike,
On the CB030 homepage are memory diagnostic for 16meg and 64meg DRAM. The 16meg DRAM test runs fairly fast, about 45 seconds per pass. The 64 meg test takes 4 times longer. You should see console messages like below.
Bill
I'm going to try testing the 64MB SIMM once I've updated the CPLD to your latest version. But that may be after I figure out who is triggering the IRQ 256. I think it's the 68681 timer left on from the boot loader. The 68681 UART is run mostly in PIO mode so it's probably not it. And I think those are the only two interrupts in the system. So hopefully it's one or the other.
The dram64m.txt file is in Motorola S-REC format. When I convert it to binary, I get:
Altair=>od -t x1 dram64m.bin |p 03/16 9:18:24pm
0000000 46 fc 20 00 43 fa 02 b4 10 3c 00 0e 4e 4f 26 3c
0000020 00 00 1e 4f 74 01 4e 7b 20 02 42 86 45 f9 00 00
0000040 32 f8 24 3c 03 ff f0 00 28 03 24 c4 d8 bc 00 00
0000060 26 f5 b5 c2 66 f4 45 f9 00 00 32 f8 24 3c 03 ff
0000100 f0 00 2a 03 28 1a ba 84 67 00 00 54 52 46 43 fa
0000120 02 7d 10 3c 00 0e 4e 4f 20 05 61 00 01 88 43 fa
0000140 01 bc 10 3c 00 0e 4e 4f 43 fa 02 6d 10 3c 00 0e
0000160 4e 4f 20 04 61 00 01 6e 43 fa 01 a2 10 3c 00 0e
0000200 4e 4f 43 fa 02 67 10 3c 00 0e 4e 4f 20 0a 59 80
0000220 61 00 01 52 43 fa 01 86 10 3c 00 0e 4e 4f da bc
That doesn't look like a proper M68K ROM. I'd expect a SP,PC combo to start with.
The dram64m.txt file starts with:
S0100000433A4452414D36344D2E48455884
S120300046FC200043FA02B4103C000E4E4F263C00001E4F74014E7B200242864527
S120301DF9000032F8243C03FFF000280324C4D8BC000026F5B5C266F445F900004C
S120303A32F8243C03FFF0002A03281ABA8467000054524643FA027D103C000E4E95
S12030574F20056100018843FA01BC103C000E4E4F43FA026D103C000E4E4F200442
S12030746100016E43FA01A2103C000E4E4F43FA0267103C000E4E4F200A59806193
What might I be doing wrong? It doesn't seem top work for me if I go ahead on load and run it.
Mike
|
|
|
Current Time: Tue Jul 15 11:48:24 PDT 2025
Total time taken to generate the page: 0.01146 seconds
|