mirror of https://github.com/deadw00d/AROS.git
Compare commits
11 Commits
bb11f7e4a9
...
7851b531aa
Author | SHA1 | Date |
---|---|---|
deadwood | 7851b531aa | |
deadwood | d750b68e5a | |
deadwood | f5ee826e7f | |
deadwood | 80046e3470 | |
deadwood | dca6bb5e1d | |
deadwood | bf8923cc3e | |
deadwood | e07e6f6c8e | |
deadwood | fe78dd20ea | |
deadwood | 8b16a5dd9e | |
deadwood | d66e110590 | |
deadwood | 69880ae41a |
|
@ -7,7 +7,7 @@ include $(SRCDIR)/config/aros.cfg
|
|||
#MM debug-tools-bifteck : includes linklibs
|
||||
|
||||
%build_prog mmake=debug-tools-bifteck \
|
||||
progname=Bifteck targetdir=$(AROS_DEBUG) \
|
||||
progname=Bifteck targetdir=$(AROS_TOOLS)/Debug\
|
||||
files=Bifteck
|
||||
|
||||
%common
|
||||
|
|
|
@ -566,22 +566,22 @@ define bttask
|
|||
if ($task->tc_Node.ln_Type != 1) && ($task->tc_Node.ln_Type != 13)
|
||||
printf "ERROR: Given address does not look like a task or process!\n"
|
||||
else
|
||||
#FIXME: The following assumes Linux x86
|
||||
set $old_esp = $esp
|
||||
set $old_eip = $eip
|
||||
#FIXME: The following assumes Linux x86_64
|
||||
set $old_esp = $rsp
|
||||
set $old_eip = $rip
|
||||
|
||||
if $task->tc_State == 2
|
||||
printf "WARNING: TS_RUN Task. Showing normal backtrace!\n"
|
||||
else
|
||||
set $esp = $task->tc_SPReg
|
||||
set $rsp = $task->tc_SPReg
|
||||
set $taskcontext = (struct AROSCPUContext *)$task->tc_UnionETask.tc_ETask.et_RegFrame
|
||||
set $eip = $taskcontext.regs.eip
|
||||
set $rip = $taskcontext.regs.rip
|
||||
end
|
||||
|
||||
bt
|
||||
|
||||
set $esp = $old_esp
|
||||
set $eip = $old_eip
|
||||
set $rsp = $old_esp
|
||||
set $rip = $old_eip
|
||||
end
|
||||
end
|
||||
document bttask
|
||||
|
|
|
@ -85,6 +85,8 @@ static void ahci_empty_done(struct ahci_ccb *ccb);
|
|||
static void ahci_ata_cmd_done(struct ahci_ccb *ccb);
|
||||
static u_int32_t ahci_pactive(struct ahci_port *ap);
|
||||
|
||||
extern int ahci_icc_bug;
|
||||
|
||||
/*
|
||||
* Initialize the global AHCI hardware. This code does not set up any of
|
||||
* its ports.
|
||||
|
@ -1431,6 +1433,7 @@ ahci_comreset(struct ahci_port *ap, int *pmdetectp)
|
|||
cmd |= AHCI_PREG_CMD_SUD | AHCI_PREG_CMD_POD;
|
||||
cmd |= AHCI_PREG_CMD_ICC_ACTIVE;
|
||||
ahci_pwrite(ap, AHCI_PREG_CMD, cmd);
|
||||
if (!ahci_icc_bug)
|
||||
ahci_pwait_clr(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_ICC);
|
||||
|
||||
/*
|
||||
|
@ -1460,7 +1463,7 @@ retry:
|
|||
* Give the new power management state time to settle, then clear
|
||||
* pending status.
|
||||
*/
|
||||
ahci_os_sleep(1000);
|
||||
ahci_os_sleep(AhciStartDelay << 2);
|
||||
ahci_flush_tfd(ap);
|
||||
ahci_pwrite(ap, AHCI_PREG_SERR, -1);
|
||||
|
||||
|
@ -1493,7 +1496,7 @@ retry:
|
|||
break;
|
||||
}
|
||||
ahci_pwrite(ap, AHCI_PREG_SCTL, r);
|
||||
ahci_os_sleep(1000);
|
||||
ahci_os_sleep(AhciStartDelay << 2);
|
||||
|
||||
ap->ap_flags &= ~AP_F_HARSH_REINIT;
|
||||
|
||||
|
@ -1516,7 +1519,7 @@ retry:
|
|||
r &= ~AHCI_PREG_SCTL_DET_INIT;
|
||||
r |= AHCI_PREG_SCTL_DET_NONE;
|
||||
ahci_pwrite(ap, AHCI_PREG_SCTL, r);
|
||||
ahci_os_sleep(1000);
|
||||
ahci_os_sleep(AhciStartDelay << 2);
|
||||
|
||||
/*
|
||||
* Try to determine if there is a device on the port. This operation
|
||||
|
@ -1535,7 +1538,7 @@ retry:
|
|||
* If we fail clear PRCS (phy detect) since we may cycled
|
||||
* the phy and probably caused another PRCS interrupt.
|
||||
*/
|
||||
loop = 2000;
|
||||
loop = AhciStartDelay * 10;
|
||||
while (loop > 0) {
|
||||
r = ahci_pread(ap, AHCI_PREG_SSTS);
|
||||
if (r & AHCI_PREG_SSTS_DET)
|
||||
|
@ -1656,7 +1659,7 @@ ahci_port_hardreset(struct ahci_port *ap, int hard)
|
|||
/*
|
||||
* Finish up.
|
||||
*/
|
||||
ahci_os_sleep(500);
|
||||
ahci_os_sleep(AhciStartDelay << 1);
|
||||
|
||||
switch(error) {
|
||||
case 0:
|
||||
|
@ -1811,6 +1814,7 @@ ahci_port_hardstop(struct ahci_port *ap)
|
|||
AHCI_PREG_CMD_SUD |
|
||||
AHCI_PREG_CMD_ICC_ACTIVE;
|
||||
ahci_pwrite(ap, AHCI_PREG_CMD, cmd);
|
||||
if (!ahci_icc_bug)
|
||||
ahci_pwait_clr(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_ICC);
|
||||
|
||||
/*
|
||||
|
|
|
@ -665,6 +665,7 @@ void ahci_os_unlock_port(struct ahci_port *ap);
|
|||
extern u_int32_t AhciForceGen;
|
||||
extern u_int32_t AhciNoFeatures;
|
||||
extern int ahci_synchronous_boot;
|
||||
extern u_int32_t AhciStartDelay;
|
||||
|
||||
enum {AHCI_LINK_PWR_MGMT_NONE, AHCI_LINK_PWR_MGMT_MEDIUM,
|
||||
AHCI_LINK_PWR_MGMT_AGGR};
|
||||
|
|
|
@ -148,10 +148,10 @@ int ahci_os_softsleep(void)
|
|||
{
|
||||
struct IORequest *io = ahci_OpenTimer();
|
||||
if (io != NULL) {
|
||||
ahci_WaitTO(io, 0, 100 * 1000, 0);
|
||||
ahci_WaitTO(io, 0, 50 * 1000, 0);
|
||||
ahci_CloseTimer(io);
|
||||
}
|
||||
return 100;
|
||||
return 50;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -175,14 +175,13 @@ void bus_dmamem_free(bus_dma_tag_t tag, void *vaddr, bus_dmamap_t map)
|
|||
int bus_dmamap_create(bus_dma_tag_t tag, unsigned flags, bus_dmamap_t *map)
|
||||
{
|
||||
DDMA(bug("[AHCI] %s()\n", __func__));
|
||||
bus_dmamem_alloc(tag, NULL, 0, map);
|
||||
*map = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bus_dmamap_destroy(bus_dma_tag_t tag, bus_dmamap_t map)
|
||||
{
|
||||
DDMA(bug("[AHCI] %s()\n", __func__));
|
||||
bus_dmamem_free(tag, NULL, map);
|
||||
}
|
||||
|
||||
int bus_dmamap_load(bus_dma_tag_t tag, bus_dmamap_t map, void *data, size_t len, bus_dmamap_callback_t *callback, void *info, unsigned flags)
|
||||
|
@ -198,6 +197,10 @@ void bus_dmamap_sync(bus_dma_tag_t tag, bus_dmamap_t map, unsigned flags)
|
|||
|
||||
DDMA(bug("[AHCI] %s()\n", __func__));
|
||||
|
||||
/* Note: this works for rfis, cmd_list and cmd_table, because the go through bus_dmamem_alloc which is implemented
|
||||
to set map to vaddr. In case of prdt, the memory DMAed with device comes from outside and should actually be
|
||||
"assigned" to map in bus_dmamap_load so that it can be used here */
|
||||
|
||||
if (!(flags & (1 << 31)))
|
||||
CachePreDMA(map, &len, flags);
|
||||
else
|
||||
|
|
|
@ -119,6 +119,7 @@ static const struct ahci_pciid ahci_msi_blacklist[] = {
|
|||
|
||||
static int ahci_msi_enable = 1;
|
||||
int ahci_synchronous_boot = 1;
|
||||
int ahci_icc_bug = 0;
|
||||
|
||||
/*
|
||||
* Match during probe and attach. The device does not yet have a softc.
|
||||
|
@ -296,6 +297,10 @@ ahci_pci_attach(device_t dev)
|
|||
}
|
||||
}
|
||||
|
||||
/* VirtualBox AHCI controller */
|
||||
if (vid == PCI_VENDOR_INTEL && did == 0x2829 && rev == 0x2)
|
||||
ahci_icc_bug = 1;
|
||||
|
||||
sc->sc_irq_type = pci_alloc_1intr(dev, msi_enable,
|
||||
&sc->sc_rid_irq, &irq_flags);
|
||||
|
||||
|
@ -614,7 +619,7 @@ noccc:
|
|||
for (i = 0; i < AHCI_MAX_PORTS; i++) {
|
||||
if ((ap = sc->sc_ports[i]) != NULL) {
|
||||
while (ap->ap_signal & AP_SIGF_THREAD_SYNC)
|
||||
ahci_os_sleep(1000);
|
||||
ahci_os_sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -638,13 +643,13 @@ noccc:
|
|||
for (i = 0; i < AHCI_MAX_PORTS && ahci_synchronous_boot; i++) {
|
||||
if ((ap = sc->sc_ports[i]) != NULL) {
|
||||
while (ap->ap_signal & AP_SIGF_INIT)
|
||||
ahci_os_sleep(1000);
|
||||
ahci_os_sleep(100);
|
||||
ahci_os_lock_port(ap);
|
||||
if (ahci_cam_attach(ap) == 0) {
|
||||
ahci_cam_changed(ap, NULL, -1);
|
||||
ahci_os_unlock_port(ap);
|
||||
while ((ap->ap_flags & AP_F_SCAN_COMPLETED) == 0) {
|
||||
ahci_os_sleep(1000);
|
||||
ahci_os_sleep(100);
|
||||
}
|
||||
} else {
|
||||
ahci_os_unlock_port(ap);
|
||||
|
|
|
@ -31,27 +31,6 @@
|
|||
|
||||
#include LC_LIBDEFS_FILE
|
||||
|
||||
static const char *str_typedisk = "DISK";
|
||||
static const char *str_typeatapi = "ATAPI";
|
||||
static const char *str_typeunk = "UNKNOWN(ATAPI?)";
|
||||
|
||||
static const char *str_enabled = "enabled";
|
||||
static const char *str_disabled = "disabled";
|
||||
static const char *str_enabling = "enabling";
|
||||
static const char *str_frozen = "frozen";
|
||||
static const char *str_unfrozen = "unfrozen";
|
||||
static const char *str_disabled2 = "<disabled>";
|
||||
static const char *str_freezing = "freezing";
|
||||
static const char *str_unsupported = "notsupp";
|
||||
|
||||
static const char *str_yes = "YES";
|
||||
static const char *str_no = "NO";
|
||||
|
||||
static const char *str_found = "%s: Found %s \"%*.*s %*.*s\" serial=\"%*.*s\"\n"
|
||||
"%s: tags=%d/%d satacap=%04x satafea=%04x NCQ=%s "
|
||||
"capacity=%lld.%02dMB\n";
|
||||
static const char *str_found2 = "%s: f85=%04x f86=%04x f87=%04x WC=%s RA=%s SEC=%s\n";
|
||||
static const char *str_unabletoident = "%s: Detected %s device but unable to IDENTIFY\n";
|
||||
/*
|
||||
* Execute a SCSI TEST UNIT READY every 250ms, to see
|
||||
* if the medium has changed.
|
||||
|
@ -295,7 +274,7 @@ static BOOL ahci_RegisterVolume(struct ahci_port *ap, struct ata_port *at, struc
|
|||
pp[DE_BLKSPERTRACK + 4] = at->at_identify.nsectors;
|
||||
pp[DE_RESERVEDBLKS + 4] = 2;
|
||||
pp[DE_LOWCYL + 4] = 0;
|
||||
pp[DE_HIGHCYL + 4] = (ap->ap_type == ATA_PORT_T_DISK) ? (at->at_identify.ncyls - 1) : 0;
|
||||
pp[DE_HIGHCYL + 4] = (ap->ap_type == ATA_PORT_T_DISK) ? (at->at_ncyls - 1) : 0;
|
||||
pp[DE_NUMBUFFERS + 4] = 10;
|
||||
pp[DE_BUFMEMTYPE + 4] = MEMF_PUBLIC;
|
||||
pp[DE_MAXTRANSFER + 4] = 0x00200000;
|
||||
|
@ -441,6 +420,53 @@ ata_fix_identify(struct ata_identify *id)
|
|||
swap[i] = bswap16(swap[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
ata_fix_chs(struct ata_identify *id, u_int32_t *ncyls, u_int64_t capacity48)
|
||||
{
|
||||
*ncyls = id->ncyls;
|
||||
|
||||
if (le16toh(id->cmdset83) & 0x0400) {
|
||||
/* LBA48 feature set supported */
|
||||
/* Code copied from ata.device */
|
||||
ULONG div = 1;
|
||||
/*
|
||||
* TODO: this shouldn't be casted down here.
|
||||
*/
|
||||
ULONG sec = capacity48;
|
||||
|
||||
if (sec < capacity48)
|
||||
sec = ~((ULONG)0);
|
||||
|
||||
id->nsectors = 63;
|
||||
sec /= 63;
|
||||
|
||||
/*
|
||||
* keep dividing by 2
|
||||
*/
|
||||
do
|
||||
{
|
||||
if (((sec >> 1) << 1) != sec)
|
||||
break;
|
||||
if ((div << 1) > 255)
|
||||
break;
|
||||
div <<= 1;
|
||||
sec >>= 1;
|
||||
} while (1);
|
||||
|
||||
do
|
||||
{
|
||||
if (((sec / 3) * 3) != sec)
|
||||
break;
|
||||
if ((div * 3) > 255)
|
||||
break;
|
||||
div *= 3;
|
||||
sec /= 3;
|
||||
} while (1);
|
||||
|
||||
*ncyls = sec;
|
||||
id->nheads = div;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Dummy done callback for xa.
|
||||
*/
|
||||
|
@ -786,6 +812,8 @@ ahci_cam_probe(struct ahci_port *ap, struct ata_port *atx)
|
|||
|
||||
capacity_bytes = capacity * 512;
|
||||
|
||||
ata_fix_chs(&at->at_identify, &at->at_ncyls, at->at_capacity);
|
||||
|
||||
/*
|
||||
* Negotiate NCQ, throw away any ata_xfer's beyond the negotiated
|
||||
* number of slots and limit the number of CAM ccb's to one less
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
u_int32_t AhciForceGen = 0;
|
||||
u_int32_t AhciNoFeatures = 0;
|
||||
u_int32_t AhciStartDelay = 25;
|
||||
|
||||
#include LC_LIBDEFS_FILE
|
||||
|
||||
|
@ -134,6 +135,11 @@ static int AHCI_Init(struct AHCIBase *AHCIBase)
|
|||
D(bug("[AHCI--] %s: Disabling AHCI features\n", __func__));
|
||||
AhciNoFeatures = -1;
|
||||
}
|
||||
if (strstr(CmdLine, "slowerstart"))
|
||||
{
|
||||
D(bug("[AHCI--] %s: Using original start delays\n", __func__));
|
||||
AhciStartDelay = 250;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -330,7 +330,7 @@ AROS_LH1(void, BeginIO,
|
|||
SetMem(geom, 0, len);
|
||||
if (ap->ap_type == ATA_PORT_T_DISK) {
|
||||
geom->dg_SectorSize = at->at_identify.sector_size;
|
||||
geom->dg_Cylinders = at->at_identify.ncyls;
|
||||
geom->dg_Cylinders = at->at_ncyls;
|
||||
geom->dg_CylSectors = at->at_identify.nsectors * at->at_identify.nheads;
|
||||
if (((UQUAD)geom->dg_Cylinders * geom->dg_CylSectors) >> 32 != 0)
|
||||
geom->dg_TotalSectors = 0xffffffff;
|
||||
|
|
|
@ -303,7 +303,7 @@ retry:
|
|||
* target 0, because when a PM is attached target 0 represents
|
||||
* slot #0 behind the PM.
|
||||
*/
|
||||
if (ahci_poll(ccb, 5000, ahci_quick_timeout) != ATA_S_COMPLETE) {
|
||||
if (ahci_poll(ccb, 500 + (AhciStartDelay * 20), ahci_quick_timeout) != ATA_S_COMPLETE) {
|
||||
kprintf("%s: PMPROBE(2) No Port Multiplier was found.\n",
|
||||
PORTNAME(ap));
|
||||
if (--count) {
|
||||
|
|
|
@ -325,6 +325,7 @@ struct ata_port {
|
|||
u_int64_t at_capacity; /* only if ATA_PORT_T_DISK */
|
||||
int at_target; /* port multiplier port */
|
||||
char at_name[16];
|
||||
u_int32_t at_ncyls; /* only if ATA_PORT_T_DISK */
|
||||
};
|
||||
|
||||
struct ata_xfer {
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
# include <exec/semaphores.h>
|
||||
#endif
|
||||
|
||||
#include <hidd/hidd.h>
|
||||
#include <hidd/gfx.h>
|
||||
|
||||
#define ATTRBASES_NUM 6
|
||||
|
||||
struct HeadlessGfx_staticdata
|
||||
|
|
Loading…
Reference in New Issue