How to debug BTX loader?
Hi guys, I'm currently working on a BIOS for a custom Single Board Computer (SBC). I have the required BIOS source code and tools at hand. However, the boot process always stuck in the BTX loader (the infamous "ACPI autoload failed") when I booted out of USB stick (with the FreeBSD 8.1 USB stick image). I could get the system to boot into FreeBSD 8.1 (by keeping the CDROM tray open and close it when the board looks for boot device, otherwise BTX will reboot instantly). The target development is actually pfsense 2.0 which is based on FreeBSD 8.0. I need to know how to make BTX be as "verbose as possible" in order to find out what went wrong with the BIOS. I'm suspecting that the el-torito support in the BIOS is incomplete. Nonetheless, I need hints about debugging the BTX loader to pin point the exact problem(s). Anyway, I have fixed the first issue which involves erratic PCI IRQ routing and the board works just fine in Windows XP and Linux (Backtrack 3 and CentOS i386). I found that FreeBSD boot CD contains this file: boot/defaults/loader.conf In order to get verbose BTX output, do I need to set the 'verbose_loading="NO"' to "YES"? I'm thinking about "editing" FreeBSD USB stick boot image (how to do that?) Another thing is, where to find guides about BTX development/debugging in order to analyse a crash dump from the BTX? I have been googling for one night but doesn't find enough info. I read the FreeBSD developer handbook but BTX is not explained in detail there. Where is the location of the BTX source code in FreeBSD source code? That's a lot of questions. Thanks in advance for any response. Regards, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: How to debug BTX loader?
Hi John, --- On Tue, 11/30/10, John Baldwin wrote: > From: John Baldwin > Subject: Re: How to debug BTX loader? > To: freebsd-hackers@freebsd.org > Cc: "Darmawan Salihun" > Date: Tuesday, November 30, 2010, 9:38 AM > On Monday, November 29, 2010 1:01:27 > pm Darmawan Salihun wrote: > > Hi guys, > > > > I'm currently working on a BIOS for a custom Single > Board Computer (SBC). > > I have the required BIOS source code and tools at > hand. > > However, the boot process always stuck in the BTX > loader > > (the infamous "ACPI autoload failed") when I booted > out of USB stick > > (with the FreeBSD 8.1 USB stick image). > > > > I could get the system to boot into FreeBSD 8.1 > > (by keeping the CDROM tray open and close it when the > board looks for > > boot device, otherwise BTX will reboot instantly). > > Are you getting an actual BTX error message or a > freeze? Booting from CDROM connected to via USB to CDROM converter would always failed (triple fault, then instant reboot), unless I left the CDROM tray open and then close it when the BIOS displays "no boot device" error message. In the latter case, FreeBSD 8.0 and 8.1 would boot just fine. Booting from CF-card connected via USB CF card adapter with pfsense 1.2.3 would freeze the system when BTX executes. It freezes with a register dump of the BTX. I'll post the registers dump shortly. Anyway, the system I'm working with is an SBC based on the AMD Geode LX800. > BTX is just a > minikernel written all in assembly. It doesn't handle > loading the kernel, > etc. All that work is done by the /boot/loader > program (which is written in > C). You can find all the source to the boot code in > src/sys/boot. The BTX > kernel is in src/sys/boot/i386/btx/btx/. > Ok. Thanks. > However, to debug this further we would need more info such > as what exactly > you are seeing (a hang, a BTX fault with a register dump, > etc.). > I'll post the error message in various boot device settings shortly. Thanks, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: How to debug BTX loader?
Hi John, --- On Tue, 11/30/10, John Baldwin wrote: > From: John Baldwin > Subject: Re: How to debug BTX loader? > To: freebsd-hackers@freebsd.org > Cc: "Darmawan Salihun" > Date: Tuesday, November 30, 2010, 9:38 AM > On Monday, November 29, 2010 1:01:27 > pm Darmawan Salihun wrote: > > Hi guys, > > > > I'm currently working on a BIOS for a custom Single > Board Computer (SBC). > > I have the required BIOS source code and tools at > hand. > > However, the boot process always stuck in the BTX > loader > > (the infamous "ACPI autoload failed") when I booted > out of USB stick > > (with the FreeBSD 8.1 USB stick image). > > > > I could get the system to boot into FreeBSD 8.1 > > (by keeping the CDROM tray open and close it when the > board looks for > > boot device, otherwise BTX will reboot instantly). > > Are you getting an actual BTX error message or a > freeze? BTX is just a > minikernel written all in assembly. It doesn't handle > loading the kernel, > etc. All that work is done by the /boot/loader > program (which is written in > C). You can find all the source to the boot code in > src/sys/boot. The BTX > kernel is in src/sys/boot/i386/btx/btx/. > > However, to debug this further we would need more info such > as what exactly > you are seeing (a hang, a BTX fault with a register dump, > etc.). One of the BTX fault shows the register dump in the attachment. I hope this could help. Anyway, If I were to try to interpret such register dump, where should I start? I understand x86/x86_64 assembly pretty much, but I'm not quite well versed with the FreeBSD code using it. Thanks, Darmawan > > -- > John Baldwin > ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: How to debug BTX loader?
Hi John, --- On Thu, 12/2/10, John Baldwin wrote: > From: John Baldwin > Subject: Re: How to debug BTX loader? > To: freebsd-hackers@freebsd.org > Cc: "Darmawan Salihun" > Date: Thursday, December 2, 2010, 8:58 AM > On Wednesday, December 01, 2010 > 4:09:42 pm Darmawan Salihun wrote: > > Hi John, > > > > --- On Tue, 11/30/10, John Baldwin > wrote: > > > > > From: John Baldwin > > > Subject: Re: How to debug BTX loader? > > > To: freebsd-hackers@freebsd.org > > > Cc: "Darmawan Salihun" > > > Date: Tuesday, November 30, 2010, 9:38 AM > > > On Monday, November 29, 2010 1:01:27 > > > pm Darmawan Salihun wrote: > > > > Hi guys, > > > > > > > > I'm currently working on a BIOS for a custom > Single > > > Board Computer (SBC). > > > > I have the required BIOS source code and > tools at > > > hand. > > > > However, the boot process always stuck in > the BTX > > > loader > > > > (the infamous "ACPI autoload failed") when I > booted > > > out of USB stick > > > > (with the FreeBSD 8.1 USB stick image). > > > > > > > > I could get the system to boot into FreeBSD > 8.1 > > > > (by keeping the CDROM tray open and close it > when the > > > board looks for > > > > boot device, otherwise BTX will reboot > instantly). > > > > > > Are you getting an actual BTX error message or a > > > freeze? BTX is just a > > > minikernel written all in assembly. It > doesn't handle > > > loading the kernel, > > > etc. All that work is done by the > /boot/loader > > > program (which is written in > > > C). You can find all the source to the boot > code in > > > src/sys/boot. The BTX > > > kernel is in src/sys/boot/i386/btx/btx/. > > > > > > However, to debug this further we would need more > info such > > > as what exactly > > > you are seeing (a hang, a BTX fault with a > register dump, > > > etc.). > > > > One of the BTX fault shows the register dump in the > attachment. > > I hope this could help. Anyway, If I were to try to > interpret > > such register dump, where should I start? I understand > x86/x86_64 > > assembly pretty much, but I'm not quite well versed > with the > > FreeBSD code using it. > > Looks like the mailing list stripped the attachment. > Can you post the > attachment at a URL? > The BTX crash message is in the attachment. Regards, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
PCI IDE Controller Base Address Register setting
Hi, I'm trying to install FreeBSD 8.0 on AMD Geode LX800 (CS5536 "southbridge"). However, it cannot detect the IDE controller (in the CS5536) correctly. It says something similar to this: "IDE controller not present" I did lspci in Linux (BackTrack 3) and I saw that the IDE controller Base Address Registers (BARs) are all disabled (only contains zeros), except for one of them (BAR4). BAR4 decodes 16-bytes I/O ports (FFF0h-h). The decoded ports "seems" to conform to the PCI IDE specification for "native-PCI IDE controller" (relocatable within the 16-bit I/O address space). I did "cat /proc/ioports" and I found that the following I/O port address ranges decoded correctly to the IDE controller in the CS5536 "southbridge": 1F0h-1F7h 3F6h 170h-177h FFF0h-h My question: Does FreeBSD require the IDE controller BARs to be programmed to also decode legacy I/O ports ranges (1F0h-1F7h,3F6h and 170h-177h)? What if those ranges are not programmed into the BARs of the IDE controller? Would the IDE controller be considered not present (disabled)? TIA, Darmawan PS: I'm working on the BIOS for this particular system but I have yet to be able to program the BARs to the aforementioned legacy I/O port ranges. This system is very peculiar because the PCI subsystem is virtualized. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: PCI IDE Controller Base Address Register setting
Hi, --- On Tue, 12/28/10, John Baldwin wrote: > From: John Baldwin > Subject: Re: PCI IDE Controller Base Address Register setting > To: freebsd-hackers@freebsd.org > Cc: "Darmawan Salihun" > Date: Tuesday, December 28, 2010, 10:20 AM > On Monday, December 27, 2010 6:07:35 > am Darmawan Salihun wrote: > > Hi, > > > > I'm trying to install FreeBSD 8.0 on AMD Geode LX800 > (CS5536 "southbridge"). > However, it cannot detect the IDE controller (in the > CS5536) correctly. It > says something similar to this: > > "IDE controller not present" > > Hmm, I can't find a message like that anywhere. Can > you get the exact message > you are seeing? > It says: "No disks found! Please verify that your disk controller is being properly probed at boot time." This happens as I try to run fdisk during installation. The IDE HDD is on the primary slave because the primary master is a CF slot. Moreover, the integrated IDE controller only has support for __single__ IDE channel, the primary IDE channel. > > I did lspci in Linux (BackTrack 3) > > and I saw that the IDE controller Base Address > Registers (BARs) > > are all disabled (only contains zeros), > > except for one of them (BAR4). > > BAR4 decodes 16-bytes I/O ports (FFF0h-h). > > The decoded ports "seems" to conform to the PCI IDE > specification > > for "native-PCI IDE controller" (relocatable within > the > > 16-bit I/O address space). > > > > I did "cat /proc/ioports" and I found that > > the following I/O port address ranges decoded > correctly > > to the IDE controller in the CS5536 "southbridge": > > > > 1F0h-1F7h > > 3F6h > > 170h-177h > > FFF0h-h > > > > My question: > > Does FreeBSD require the IDE controller BARs > > to be programmed to also decode > > legacy I/O ports ranges (1F0h-1F7h,3F6h and > 170h-177h)? > > No. We hardcode the ISA ranges for BARs 0 through 3 > if a PCI IDE controller > has the "Primary" or "Secondary" bits set in its > programming interface > register and don't even look at the BARs. Probably, the current setting in the PCI configuration space of the IDE controller contains some error in the programming interface register. I'll re-probe with lspci and report back. > We do > always examines BARs 4 and 5 > using the normal probing scheme of writing all 1's, > etc. The code in question > looks like this: > > /* > * For ATA devices we need to decide early what addressing > mode to use. > * Legacy demands that the primary and secondary ATA ports > sits on the > * same addresses that old ISA hardware did. This dictates > that we use > * those addresses and ignore the BAR's if we cannot set > PCI native > * addressing mode. > */ > static void > pci_ata_maps(device_t bus, device_t dev, struct > resource_list *rl, int force, > uint32_t prefetchmask) > { > struct resource *r; > int rid, type, progif; > #if 0 > /* if this device supports PCI native > addressing use it */ > progif = pci_read_config(dev, > PCIR_PROGIF, 1); > if ((progif & 0x8a) == 0x8a) { > if > (pci_mapbase(pci_read_config(dev, PCIR_BAR(0), 4)) > && > > pci_mapbase(pci_read_config(dev, PCIR_BAR(2), 4))) { > > printf("Trying ATA native PCI addressing mode\n"); > > pci_write_config(dev, PCIR_PROGIF, progif | 0x05, 1); > } > } > #endif > progif = pci_read_config(dev, > PCIR_PROGIF, 1); > type = SYS_RES_IOPORT; > if (progif & > PCIP_STORAGE_IDE_MODEPRIM) { > pci_add_map(bus, dev, > PCIR_BAR(0), rl, force, > > prefetchmask & (1 << 0)); > pci_add_map(bus, dev, > PCIR_BAR(1), rl, force, > > prefetchmask & (1 << 1)); > } else { > rid = PCIR_BAR(0); > resource_list_add(rl, > type, rid, 0x1f0, 0x1f7, 8); > r = > resource_list_reserve(rl, bus, dev, type, &rid, 0x1f0, > 0x1f7, > 8, 0); > rid = PCIR_BAR(1); > resource_list_add(rl, > type, rid, 0x3f6, 0x3f6, 1); > r = > resource_list_reserve(rl, bus, dev, type, &rid, 0x3f6, > 0x3f6, > 1, 0); > } > if (progif & > PCIP_STORAGE_IDE_MODESEC) { > pci_add_map(bus, dev, > PCIR_BAR(2), rl, force, > > prefetchmask & (1 << 2)); > pci_add_map(bus, dev, > PCIR_BAR(3), rl, force, >
Re: PCI IDE Controller Base Address Register setting
Hi, --- On Tue, 12/28/10, John Baldwin wrote: > From: John Baldwin > Subject: Re: PCI IDE Controller Base Address Register setting > To: "Darmawan Salihun" > Cc: freebsd-hackers@freebsd.org > Date: Tuesday, December 28, 2010, 1:52 PM > On Tuesday, December 28, 2010 1:38:05 > pm Darmawan Salihun wrote: > > Hi, > > > > --- On Tue, 12/28/10, John Baldwin > wrote: > > > > > From: John Baldwin > > > Subject: Re: PCI IDE Controller Base Address > Register setting > > > To: freebsd-hackers@freebsd.org > > > Cc: "Darmawan Salihun" > > > Date: Tuesday, December 28, 2010, 10:20 AM > > > On Monday, December 27, 2010 6:07:35 > > > am Darmawan Salihun wrote: > > > > Hi, > > > > > > > > I'm trying to install FreeBSD 8.0 on AMD > Geode LX800 > > > (CS5536 "southbridge"). > > > However, it cannot detect the IDE controller (in > the > > > CS5536) correctly. It > > > says something similar to this: > > > > "IDE controller not present" > > > > > > Hmm, I can't find a message like that > anywhere. Can > > > you get the exact message > > > you are seeing? > > > > > > > It says: > > > > "No disks found! Please verify that your disk > controller is being properly > > probed at boot time." > > Oh, so this is a message from the installer. Can you > capture a verbose dmesg > via a serial console perhaps? I'm not sure if I can do this because I've tried a couple of times but nothing comes out of the serial console. Perhaps a wrong baud rate setting? I set it to 96bps and 8-N-1 back then. Is that correct? > Or at least the kernel > probe messages for your > ATA controller? > I recall that pressing Alt+F2 during the installation would open-up another console, full with log messages. Would that be enough? Thanks, Darmawan > -- > John Baldwin > ___ > freebsd-hackers@freebsd.org > mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org" > ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: PCI IDE Controller Base Address Register setting
--- On Tue, 12/28/10, John Baldwin wrote: > From: John Baldwin > Subject: Re: PCI IDE Controller Base Address Register setting > To: "Darmawan Salihun" > Cc: freebsd-hackers@freebsd.org > Date: Tuesday, December 28, 2010, 2:22 PM > On Tuesday, December 28, 2010 2:10:59 > pm Darmawan Salihun wrote: > > Hi, > > > > --- On Tue, 12/28/10, John Baldwin > wrote: > > > > > From: John Baldwin > > > Subject: Re: PCI IDE Controller Base Address > Register setting > > > To: "Darmawan Salihun" > > > Cc: freebsd-hackers@freebsd.org > > > Date: Tuesday, December 28, 2010, 1:52 PM > > > On Tuesday, December 28, 2010 1:38:05 > > > pm Darmawan Salihun wrote: > > > > Hi, > > > > > > > > --- On Tue, 12/28/10, John Baldwin > > > wrote: > > > > > > > > > From: John Baldwin > > > > > Subject: Re: PCI IDE Controller Base > Address > > > Register setting > > > > > To: freebsd-hackers@freebsd.org > > > > > Cc: "Darmawan Salihun" > > > > > Date: Tuesday, December 28, 2010, 10:20 > AM > > > > > On Monday, December 27, 2010 6:07:35 > > > > > am Darmawan Salihun wrote: > > > > > > Hi, > > > > > > > > > > > > I'm trying to install FreeBSD 8.0 > on AMD > > > Geode LX800 > > > > > (CS5536 "southbridge"). > > > > > However, it cannot detect the IDE > controller (in > > > the > > > > > CS5536) correctly. It > > > > > says something similar to this: > > > > > > "IDE controller not present" > > > > > > > > > > Hmm, I can't find a message like that > > > anywhere. Can > > > > > you get the exact message > > > > > you are seeing? > > > > > > > > > > > > > It says: > > > > > > > > "No disks found! Please verify that your > disk > > > controller is being properly > > > > probed at boot time." > > > > > > Oh, so this is a message from the > installer. Can you > > > capture a verbose dmesg > > > via a serial console perhaps? > > > > I'm not sure if I can do this because I've tried a > couple of times > > but nothing comes out of the serial console. Perhaps a > wrong baud rate setting? > > I set it to 96bps and 8-N-1 back then. Is that > correct? > > Yes, that should be correct. You have to turn the > console on however (it is > not enabled by default). The simplest way to do this > is probably to hit the > key option to break into the loader prompt when you see the > boot menu (I think > it is option '6'). Then enter 'boot -D' at the 'OK' > prompt. This should boot > with both the video and serial consoles enabled with the > video console as the > primary console. For a verbose boot, use 'boot -Dv' > Thanks, I tested this option and it worked. I could see the debugging messages. FreeBSD cannot detect the disk in all of the IDE interfaces. (The AMDCS5536 only implemented the primary channel) Anyway, I manage to change the mapping in BAR4 of the IDE controller. However, I'm confused as to how to "force" FreeBSD to recognize the IDE controller to work only in compatibility mode. Because, I'm not sure if the physical IDE controller chip supports Native-PCI mode correctly at all. If I set BAR4 to "disabled"(i.e. not decoding any I/O addresses at all), would FreeBSD use compatibility mode? or would it consider the IDE controller not present? Here's some notes about the IDE controller PCI configuration registers: 1. The Programming Interface register contains 80h (which means _only_ compatibility mode supported). I have yet to be able to write new values into this register. That's the state of the register right now. I noticed in your previous reply that for FreeBSD to be forced to use compatibility mode, the programming interface register bits in the PCI configuration register must be set accordingly (I suppose the bits in the lower nibble). 2. BAR0-BAR3 cannot be changed and contains 00h. I have yet to experiment with BAR5.The default value is 00h Thanks in advance, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: PCI IDE Controller Base Address Register setting
--- On Thu, 12/30/10, Darmawan Salihun wrote: > From: Darmawan Salihun > Subject: Re: PCI IDE Controller Base Address Register setting > To: "John Baldwin" > Cc: freebsd-hackers@freebsd.org > Date: Thursday, December 30, 2010, 3:28 PM > --- On Tue, 12/28/10, John Baldwin > > wrote: > > > From: John Baldwin > > Subject: Re: PCI IDE Controller Base Address Register > setting > > To: "Darmawan Salihun" > > Cc: freebsd-hackers@freebsd.org > > Date: Tuesday, December 28, 2010, 2:22 PM > > On Tuesday, December 28, 2010 2:10:59 > > pm Darmawan Salihun wrote: > > > Hi, > > > > > > --- On Tue, 12/28/10, John Baldwin > > wrote: > > > > > > > From: John Baldwin > > > > Subject: Re: PCI IDE Controller Base > Address > > Register setting > > > > To: "Darmawan Salihun" > > > > Cc: freebsd-hackers@freebsd.org > > > > Date: Tuesday, December 28, 2010, 1:52 PM > > > > On Tuesday, December 28, 2010 1:38:05 > > > > pm Darmawan Salihun wrote: > > > > > Hi, > > > > > > > > > > --- On Tue, 12/28/10, John Baldwin > > > > > wrote: > > > > > > > > > > > From: John Baldwin > > > > > > Subject: Re: PCI IDE Controller > Base > > Address > > > > Register setting > > > > > > To: freebsd-hackers@freebsd.org > > > > > > Cc: "Darmawan Salihun" > > > > > > Date: Tuesday, December 28, 2010, > 10:20 > > AM > > > > > > On Monday, December 27, 2010 > 6:07:35 > > > > > > am Darmawan Salihun wrote: > > > > > > > Hi, > > > > > > > > > > > > > > I'm trying to install FreeBSD > 8.0 > > on AMD > > > > Geode LX800 > > > > > > (CS5536 "southbridge"). > > > > > > However, it cannot detect the IDE > > controller (in > > > > the > > > > > > CS5536) correctly. It > > > > > > says something similar to this: > > > > > > > "IDE controller not present" > > > > > > > > > > > > Hmm, I can't find a message like > that > > > > anywhere. Can > > > > > > you get the exact message > > > > > > you are seeing? > > > > > > > > > > > > > > > > It says: > > > > > > > > > > "No disks found! Please verify that > your > > disk > > > > controller is being properly > > > > > probed at boot time." > > > > > > > > Oh, so this is a message from the > > installer. Can you > > > > capture a verbose dmesg > > > > via a serial console perhaps? > > > > > > I'm not sure if I can do this because I've tried > a > > couple of times > > > but nothing comes out of the serial console. > Perhaps a > > wrong baud rate setting? > > > I set it to 96bps and 8-N-1 back then. Is that > > correct? > > > > Yes, that should be correct. You have to turn the > > console on however (it is > > not enabled by default). The simplest way to do > this > > is probably to hit the > > key option to break into the loader prompt when you > see the > > boot menu (I think > > it is option '6'). Then enter 'boot -D' at the 'OK' > > prompt. This should boot > > with both the video and serial consoles enabled with > the > > video console as the > > primary console. For a verbose boot, use 'boot -Dv' > > > > Thanks, I tested this option and it worked. > I could see the debugging messages. > > FreeBSD cannot detect the disk in all of the IDE > interfaces. > (The AMDCS5536 only implemented the primary channel) > > Anyway, I manage to change the mapping in BAR4 of the IDE > controller. > However, I'm confused as to how to "force" FreeBSD to > recognize the > IDE controller to work only in compatibility mode. > Because, I'm not sure if the physical IDE controller chip > supports > Native-PCI mode correctly at all. > If I set BAR4 to "disabled"(i.e. not decoding any I/O > addresses at all), > would FreeBSD use compatibility mode? or would it consider > the > IDE controller not present? > > Here's some notes
Re: PCI IDE Controller Base Address Register setting
Hi, --- On Sat, 1/1/11, Darmawan Salihun wrote: > From: Darmawan Salihun > Subject: Re: PCI IDE Controller Base Address Register setting > To: "John Baldwin" > Cc: freebsd-hackers@freebsd.org > Date: Saturday, January 1, 2011, 2:58 PM ... > > Thanks, I tested this option and it worked. > > I could see the debugging messages. > > > > FreeBSD cannot detect the disk in all of the IDE > > interfaces. > > (The AMDCS5536 only implemented the primary channel) > > > > Anyway, I manage to change the mapping in BAR4 of the > IDE > > controller. > > However, I'm confused as to how to "force" FreeBSD to > > recognize the > > IDE controller to work only in compatibility mode. > > Because, I'm not sure if the physical IDE controller > chip > > supports > > Native-PCI mode correctly at all. > > If I set BAR4 to "disabled"(i.e. not decoding any I/O > > addresses at all), > > would FreeBSD use compatibility mode? or would it > consider > > the > > IDE controller not present? > > > > Here's some notes about the IDE controller PCI > > configuration registers: > > 1. The Programming Interface register contains 80h > (which > > means _only_ > > compatibility mode supported). I have yet to be able > to > > write new values > > into this register. That's the state of the register > right > > now. > > I noticed in your previous reply that for FreeBSD to > be > > forced to use > > compatibility mode, the programming interface register > bits > > in the PCI configuration register must be set > accordingly > > (I suppose the bits in the lower nibble). > > > > 2. BAR0-BAR3 cannot be changed and contains 00h. > > I have yet to experiment with BAR5.The default value > is > > 00h > > > > Silly me that I didn't know about the SFF-8038i standard > (PCI IDE Bus mastering). So, I found out that it seems the > > allocation of I/O ports for the IDE controller is just > fine. > However, the primary IDE channel is shared between > an IDE interface and a CF card. Moreover, Linux > detects > DMA bug, because all drives connected to the interface > would be > in PIO mode :-/ > If all drives on the primary channel are "forced" to PIO > mode, then > shouldn't the "IDE PCI bus master register" (offset 20h per > SFF-8038i) > along with the command register (offset 4h), are set to > indicate the > controller doesn't support bus mastering? > Anyway, is it possible for devices on _the same_ channel to use different setting in FreeBSD? For example, the primary slave is using UDMA66 while the primary master is using PIO-4. Or such configuration is considered invalid. The AMDLX800-CS5536 board I'm working with has different connectors for the primary master and primary slave. Moreover, the chipset supports different setting in primary master and primary slave. TIA, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: PCI IDE Controller Base Address Register setting
--- On Mon, 1/3/11, Alexander Motin wrote: > From: Alexander Motin > Subject: Re: PCI IDE Controller Base Address Register setting > To: "John Baldwin" > Cc: "Darmawan Salihun" , > freebsd-hackers@freebsd.org > Date: Monday, January 3, 2011, 1:08 PM > > On Saturday, January 01, 2011 > 2:58:12 pm Darmawan Salihun wrote: > >> So, I found out that it seems the > >> allocation of I/O ports for the IDE controller is > just fine. > >> However, the primary IDE channel is shared > between > >> an IDE interface and a CF card. Moreover, > Linux detects > >> DMA bug, because all drives connected to the > interface would be > >> in PIO mode :-/ > >> If all drives on the primary channel are "forced" > to PIO mode, then > >> shouldn't the "IDE PCI bus master register" > (offset 20h per SFF-8038i) > >> along with the command register (offset 4h), are > set to indicate the > >> controller doesn't support bus mastering? > > I don't think that BIOS should change controller > capabilities depending on attached drives, may be except may > be for workarounding some known bugs/incompatibilities. > Otherwise this will just make hot-plug things tricky and > unpredictable. > > >> Anyway, is it possible for devices on _the same_ > channel to use > >> different setting in FreeBSD? For example, the > primary slave > >> is using UDMA66 while the primary master is using > PIO-4. > >> Or such configuration is considered invalid. > > Yes, it is possible. If automatic negotiation doesn't > succeed for some reason, you may limit initial mode for each > specific device using hint.ata.X.devY.mode loader tunables, > added not so long ago. After boot it can also be tuned > per-device via atacontrol or camcontrol tools, depending on > ATA stack used. > > >> The AMDLX800-CS5536 board I'm working with has > different connectors > >> for the primary master and primary slave. > Moreover, the chipset > >> supports different setting in primary master and > primary slave. > > There are few other controllers not supporting such > configurations, but it is handled by their specific > drivers. > > -- Alexander Motin > I get the following log message upon booting with "boot -Dv": == ata0: on atapci0 ata0: reset tp1 mask=03 ostat0=50 ostat1=50 ata0: stat0=0x80 err=0x00 lsb=0x00 msb=0x00 ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 ata0: stat1=0x50 err=0x01 lsb=0x00 msb=0x00 ata0: reset tp2 stat0=50 stat1=50 devices=0x3 ... ata0: Identifying devices: 0003 ata0: New devices: 0003 ... ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire ata0-master: pio=PIO1 wdma=UNSUPPORTED udma=UNSUPPORTED cable=40 wire ... ad0: FAILURE setting PIO1 on CS5536 chip ad0: 488MB at ata0-master BIOSPIO ... GEOM: newdisk ad0 ad0: Adaptec check1 failed ad0: LSI(v3) check1 failed ad0: FAILURE - READ status=51 error=c4 LBA=0 ... ad1: setting PIO4 on CS5536 chip ad1: setting UDMA100 on CS5536 chip ad1: 38150MB at ata0-slave UDMA100 ... GEOM: newdisk ad1 ... ad1: FAILURE - READ_DMA status=51 error=84 LBA=78132575 ad1: FAILURE - READ_DMA status=51 error=84 LBA=78132591 ... == I have several questions: 1. How FreeBSD sets the PIO mode on the target IDE controller? what could've caused it to fail like the message above? 2. It seems to me that setting the UDMA100 in the AMD CS5536 IDE controller went just fine (in the log above). But, FreeBSD fails when it tries to read something from the drive. Does it mean the UDMA100 "mode" failed to be set correctly in the IDE controller? 3. As I'm currently trying to fix the bug in the BIOS for the particular board used to boot FreeBSD, what would you suggest to fix it? Thank you very much. Kind Regards, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: PCI IDE Controller Base Address Register setting
--- On Wed, 1/5/11, Alexander Motin wrote: > From: Alexander Motin > Subject: Re: PCI IDE Controller Base Address Register setting > To: "Darmawan Salihun" > Cc: "John Baldwin" , freebsd-hackers@freebsd.org > Date: Wednesday, January 5, 2011, 9:56 AM > Darmawan Salihun wrote: > > I get the following log message upon booting with > "boot -Dv": > > == > > ata0: on atapci0 > > ata0: reset tp1 mask=03 ostat0=50 ostat1=50 > > ata0: stat0=0x80 err=0x00 lsb=0x00 msb=0x00 > > ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 > > ata0: stat1=0x50 err=0x01 lsb=0x00 msb=0x00 > > ata0: reset tp2 stat0=50 stat1=50 devices=0x3 > > ... > > ata0: Identifying devices: 0003 > > ata0: New devices: 0003 > > ... > > ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 > wire > > ata0-master: pio=PIO1 wdma=UNSUPPORTED > udma=UNSUPPORTED cable=40 wire > > ... > > ad0: FAILURE setting PIO1 on CS5536 chip > > ad0: 488MB at > ata0-master BIOSPIO > > ... > > GEOM: newdisk ad0 > > ad0: Adaptec check1 failed > > ad0: LSI(v3) check1 failed > > ad0: FAILURE - READ status=51 > error=c4 LBA=0 > > ... > > ad1: setting PIO4 on CS5536 chip > > ad1: setting UDMA100 on CS5536 chip > > ad1: 38150MB at > ata0-slave UDMA100 > > ... > > GEOM: newdisk ad1 > > ... > > ad1: FAILURE - READ_DMA > status=51 > error=84 LBA=78132575 > > ad1: FAILURE - READ_DMA > status=51 > error=84 LBA=78132591 > > ... > > == > > I have several questions: > > 1. How FreeBSD sets the PIO mode on the target IDE > controller? > > what could've caused it to fail like the message > above? > > Looking to your messages I would suggest you are running > something like > FreeBSD 8.0. At that time controller-specific method first > set mode on > device and then programmed the chip. Most likely this error > returned by > device. Some very old devices not supporting more then PIO3 > may not > support mode setting command. > > Mode setting code was significantly rewritten between 8.0 > and 8.1. I > would recommend you to take newer version of FreeBSD for > experiments. > The device is a CF-card. Do I need to add some sort of CFA-specific initialization code to the BIOS? I'm using FreeBSD 8.0 as the test bed for the log message above. I have FreeBSD 8.1 DVD to do further tests. Will report later. > > 2. It seems to me that setting the UDMA100 in the > > AMD CS5536 IDE controller went just fine (in the log > above). > > But, FreeBSD fails when it tries to read something > from the drive. > > Does it mean the UDMA100 "mode" failed to be set > correctly > > in the IDE controller? > > It can be. For UDMA transfer rate is driven by transmitting > side (for > reading - by device), but there is always a chance to do > something > wrong. :) I don't have CS5536 board, so can't be completely > sure how > correct is the code. Does it require chipset-specific support code on the OS (say a device driver) or setting via PCI Bus Master registers is enough? > > > 3. As I'm currently trying to fix the bug in the BIOS > for the particular > > board used to boot FreeBSD, what would you suggest to > fix it? > > Try latest FreeBSD -- 8.2 is now in RC state. > Try to disconnect devices one by one. > Try to limit initial mode via loader tunables (note that > some of them > were added not so long ago and may be missing on 8.0). > A question about the loader tunable: is it enough to pass it through the "boot" command, similar to the "-Dv" in "boot -Dv"? Thanks, Darmawan ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Fw: Re: PCI IDE Controller Base Address Register setting
--- On Wed, 1/5/11, Darmawan Salihun wrote: > From: Darmawan Salihun > Subject: Re: PCI IDE Controller Base Address Register setting > To: "Alexander Motin" > Date: Wednesday, January 5, 2011, 1:48 PM > --- On Wed, 1/5/11, Alexander Motin > > wrote: > > > From: Alexander Motin > > Subject: Re: PCI IDE Controller Base Address Register > setting > > To: "Darmawan Salihun" > > Cc: freebsd-hackers@freebsd.org > > Date: Wednesday, January 5, 2011, 1:16 PM > > On 05.01.2011 19:25, Darmawan Salihun > > wrote: > > > --- On Wed, 1/5/11, Alexander Motin > > wrote: > > > > > >> From: Alexander Motin > > >> Subject: Re: PCI IDE Controller Base Address > > Register setting > > >> To: "Darmawan Salihun" > > >> Cc: "John Baldwin", > > freebsd-hackers@freebsd.org > > >> Date: Wednesday, January 5, 2011, 9:56 AM > > >> Darmawan Salihun wrote: > > >>> I get the following log message upon > booting > > with > > >> "boot -Dv": > > >>> == > > >>> ata0: on atapci0 > > >>> ata0: reset tp1 mask=03 ostat0=50 > ostat1=50 > > >>> ata0: stat0=0x80 err=0x00 lsb=0x00 > msb=0x00 > > >>> ata0: stat0=0x50 err=0x01 lsb=0x00 > msb=0x00 > > >>> ata0: stat1=0x50 err=0x01 lsb=0x00 > msb=0x00 > > >>> ata0: reset tp2 stat0=50 stat1=50 > devices=0x3 > > >>> ... > > >>> ata0: Identifying devices: 0003 > > >>> ata0: New devices: 0003 > > >>> ... > > >>> ata0-slave: pio=PIO4 wdma=WDMA2 > udma=UDMA100 > > cable=80 > > >> wire > > >>> ata0-master: pio=PIO1 wdma=UNSUPPORTED > > >> udma=UNSUPPORTED cable=40 wire > > >>> ... > > >>> ad0: FAILURE setting PIO1 on CS5536 chip > > >>> ad0: 488MB > 6.2.0> at > > >> ata0-master BIOSPIO > > >>> ... > > >>> GEOM: newdisk ad0 > > >>> ad0: Adaptec check1 failed > > >>> ad0: LSI(v3) check1 failed > > >>> ad0: FAILURE - READ > > status=51 > > >> error=c4 > > LBA=0 > > >>> ... > > >>> ad1: setting PIO4 on CS5536 chip > > >>> ad1: setting UDMA100 on CS5536 chip > > >>> ad1: 38150MB > 3.06> at > > >> ata0-slave UDMA100 > > >>> ... > > >>> GEOM: newdisk ad1 > > >>> ... > > >>> ad1: FAILURE - READ_DMA > > >> status=51 > > >> error=84 LBA=78132575 > > >>> ad1: FAILURE - READ_DMA > > >> status=51 > > >> error=84 LBA=78132591 > > >>> ... > > >>> == > > >>> I have several questions: > > >>> 1. How FreeBSD sets the PIO mode on the > target > > IDE > > >> controller? > > >>> what could've caused it to fail like the > > message > > >> above? > > >> > > >> Looking to your messages I would suggest you > are > > running > > >> something like > > >> FreeBSD 8.0. At that time > controller-specific > > method first > > >> set mode on > > >> device and then programmed the chip. Most > likely > > this error > > >> returned by > > >> device. Some very old devices not supporting > more > > then PIO3 > > >> may not > > >> support mode setting command. > > >> > > >> Mode setting code was significantly > rewritten > > between 8.0 > > >> and 8.1. I > > >> would recommend you to take newer version of > > FreeBSD for > > >> experiments. > > > > > > The device is a CF-card. Do I need to add some > sort of > > CFA-specific > > > initialization code to the BIOS? > > > > Some CF devices AFAIR may wish power-up command before > they > > will be able to access media, but I have never seen > such > > ones, suppose it was applicable only to some old > > microdrives. AFAIR in all other points CF > specification only > > extends ATA without additional requirements. > > > > > I'm using FreeBSD 8.0 as the test bed for the > log > > message above. > > > I have FreeBSD 8.1 DVD to do further tests. Will > > report later. > > > > OK. > > &g