Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
93ef77fa
Commit
93ef77fa
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 2.3.15pre2
parent
f91c3404
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
629 additions
and
212 deletions
+629
-212
drivers/pci/pci.c
drivers/pci/pci.c
+19
-4
drivers/pnp/isapnp.c
drivers/pnp/isapnp.c
+135
-149
drivers/pnp/isapnp_proc.c
drivers/pnp/isapnp_proc.c
+25
-23
drivers/video/atyfb.c
drivers/video/atyfb.c
+2
-2
drivers/video/modedb.c
drivers/video/modedb.c
+410
-0
include/linux/ioport.h
include/linux/ioport.h
+18
-24
include/linux/isapnp.h
include/linux/isapnp.h
+13
-0
include/linux/pci.h
include/linux/pci.h
+7
-10
No files found.
drivers/pci/pci.c
View file @
93ef77fa
...
...
@@ -141,6 +141,21 @@ pci_set_master(struct pci_dev *dev)
}
}
/*
* Translate the low bits of the PCI base
* to the resource type
*/
static
inline
unsigned
int
pci_resource_flags
(
unsigned
int
flags
)
{
if
(
flags
&
PCI_BASE_ADDRESS_SPACE_IO
)
return
IORESOURCE_IO
|
flags
;
if
(
flags
&
PCI_BASE_ADDRESS_MEM_PREFETCH
)
return
IORESOURCE_MEM
|
IORESOURCE_PREFETCH
;
return
IORESOURCE_MEM
;
}
void
__init
pci_read_bases
(
struct
pci_dev
*
dev
,
unsigned
int
howmany
)
{
unsigned
int
reg
;
...
...
@@ -168,16 +183,16 @@ void __init pci_read_bases(struct pci_dev *dev, unsigned int howmany)
continue
;
res
->
start
=
l
&
mask
;
res
->
flags
=
l
&
~
mask
;
l
&=
~
mask
;
res
->
flags
=
l
|
pci_resource_flags
(
l
);
size
=
1
;
do
{
size
<<=
1
;
}
while
(
!
(
size
&
newval
));
/* 64-bit memory? */
if
((
l
&
(
PCI_BASE_ADDRESS_SPACE
|
PCI_BASE_ADDRESS_MEM_TYPE_MASK
))
==
(
PCI_BASE_ADDRESS_SPACE_MEMORY
|
PCI_BASE_ADDRESS_MEM_TYPE_64
))
{
/* 64-bit decode? */
if
((
l
&
(
PCI_BASE_ADDRESS_MEM_TYPE_MASK
|
PCI_BASE_ADDRESS_SPACE
))
==
PCI_BASE_ADDRESS_MEM_TYPE_64
)
{
unsigned
int
high
;
reg
++
;
pci_read_config_dword
(
dev
,
PCI_BASE_ADDRESS_0
+
(
reg
<<
2
),
&
high
);
...
...
drivers/pnp/isapnp.c
View file @
93ef77fa
This diff is collapsed.
Click to expand it.
drivers/pnp/isapnp_proc.c
View file @
93ef77fa
...
...
@@ -380,21 +380,21 @@ static void isapnp_print_mem(isapnp_info_buffer_t *buffer, char *space, struct i
isapnp_printf
(
buffer
,
"%sMemory 0x%x-0x%x, align 0x%x, size 0x%x"
,
space
,
mem
->
min
,
mem
->
max
,
mem
->
align
,
mem
->
size
);
if
(
mem
->
flags
&
DEVICE_IO
_FLAG_WRITEABLE
)
if
(
mem
->
flags
&
ISAPNP
_FLAG_WRITEABLE
)
isapnp_printf
(
buffer
,
", writeable"
);
if
(
mem
->
flags
&
DEVICE_IO
_FLAG_CACHEABLE
)
if
(
mem
->
flags
&
ISAPNP
_FLAG_CACHEABLE
)
isapnp_printf
(
buffer
,
", cacheable"
);
if
(
mem
->
flags
&
DEVICE_IO
_FLAG_RANGELENGTH
)
if
(
mem
->
flags
&
ISAPNP
_FLAG_RANGELENGTH
)
isapnp_printf
(
buffer
,
", range-length"
);
if
(
mem
->
flags
&
DEVICE_IO
_FLAG_SHADOWABLE
)
if
(
mem
->
flags
&
ISAPNP
_FLAG_SHADOWABLE
)
isapnp_printf
(
buffer
,
", shadowable"
);
if
(
mem
->
flags
&
DEVICE_IO
_FLAG_EXPANSIONROM
)
if
(
mem
->
flags
&
ISAPNP
_FLAG_EXPANSIONROM
)
isapnp_printf
(
buffer
,
", expansion ROM"
);
switch
(
mem
->
type
)
{
case
DEVICE_IO
_TYPE_8BIT
:
case
ISAPNP
_TYPE_8BIT
:
s
=
"8-bit"
;
break
;
case
DEVICE_IO
_TYPE_8AND16BIT
:
case
ISAPNP
_TYPE_8AND16BIT
:
s
=
"8-bit&16-bit"
;
break
;
default:
...
...
@@ -734,9 +734,9 @@ static int isapnp_set_port(char *line)
return
1
;
}
isapnp_write_word
(
ISAPNP_CFG_PORT
+
(
idx
<<
1
),
port
);
if
(
isapnp_info_device
->
resource
[
idx
].
start
==
DEVICE_IO
_NOTSET
)
if
(
isapnp_info_device
->
resource
[
idx
].
start
==
ISAPNP
_NOTSET
)
return
0
;
if
(
isapnp_info_device
->
resource
[
idx
].
start
==
DEVICE_IO
_AUTO
)
{
if
(
isapnp_info_device
->
resource
[
idx
].
start
==
ISAPNP
_AUTO
)
{
isapnp_info_device
->
resource
[
idx
].
start
=
port
;
isapnp_info_device
->
resource
[
idx
].
end
+=
port
-
1
;
}
else
{
...
...
@@ -746,6 +746,12 @@ static int isapnp_set_port(char *line)
}
return
0
;
}
static
void
isapnp_set_irqresource
(
struct
resource
*
res
,
int
irq
)
{
res
->
start
=
res
->
end
=
irq
;
res
->
flags
=
IORESOURCE_IRQ
;
}
static
int
isapnp_set_irq
(
char
*
line
)
{
...
...
@@ -767,18 +773,16 @@ static int isapnp_set_irq(char *line)
return
1
;
}
isapnp_write_byte
(
ISAPNP_CFG_IRQ
+
(
idx
<<
1
),
irq
);
if
(
idx
==
0
)
{
if
(
isapnp_info_device
->
irq
==
DEVICE_IRQ_NOTSET
)
return
0
;
isapnp_info_device
->
irq
=
irq
;
}
else
{
if
(
isapnp_info_device
->
irq2
==
DEVICE_IRQ_NOTSET
)
return
0
;
isapnp_info_device
->
irq2
=
irq
;
}
isapnp_set_irqresource
(
isapnp_info_device
->
irq_resource
+
idx
,
irq
);
return
0
;
}
static
void
isapnp_set_dmaresource
(
struct
resource
*
res
,
int
dma
)
{
res
->
start
=
res
->
end
=
dma
;
res
->
flags
=
IORESOURCE_DMA
;
}
static
int
isapnp_set_dma
(
char
*
line
)
{
int
idx
,
dma
;
...
...
@@ -797,9 +801,7 @@ static int isapnp_set_dma(char *line)
return
1
;
}
isapnp_write_byte
(
ISAPNP_CFG_DMA
+
idx
,
dma
);
if
(
isapnp_info_device
->
dma
[
idx
]
==
DEVICE_DMA_NOTSET
)
return
0
;
isapnp_info_device
->
dma
[
idx
]
=
dma
;
isapnp_set_dmaresource
(
isapnp_info_device
->
dma_resource
+
idx
,
dma
);
return
0
;
}
...
...
@@ -819,9 +821,9 @@ static int isapnp_set_mem(char *line)
}
mem
>>=
8
;
isapnp_write_word
(
ISAPNP_CFG_MEM
+
(
idx
<<
2
),
mem
&
0xffff
);
if
(
isapnp_info_device
->
resource
[
idx
+
8
].
start
==
DEVICE_IO
_NOTSET
)
if
(
isapnp_info_device
->
resource
[
idx
+
8
].
start
==
ISAPNP
_NOTSET
)
return
0
;
if
(
isapnp_info_device
->
resource
[
idx
+
8
].
start
==
DEVICE_IO
_AUTO
)
{
if
(
isapnp_info_device
->
resource
[
idx
+
8
].
start
==
ISAPNP
_AUTO
)
{
isapnp_info_device
->
resource
[
idx
+
8
].
start
=
mem
&
~
0x00ffff00
;
isapnp_info_device
->
resource
[
idx
+
8
].
end
+=
(
mem
&
~
0x00ffff00
)
-
1
;
}
else
{
...
...
drivers/video/atyfb.c
View file @
93ef77fa
...
...
@@ -1951,11 +1951,11 @@ static int encode_fix(struct fb_fix_screeninfo *fix,
fix
->
mmio_len
=
0x400
;
fix
->
accel
=
FB_ACCEL_ATI_MACH64CT
;
}
else
if
(
Gx
==
VT_CHIP_ID
||
Gx
==
VU_CHIP_ID
||
Gx
==
VV_CHIP_ID
)
{
fix
->
mmio_start
=
info
->
ati_regbase_phys
-
0x400
)
;
fix
->
mmio_start
=
info
->
ati_regbase_phys
-
0x400
;
fix
->
mmio_len
=
0x800
;
fix
->
accel
=
FB_ACCEL_ATI_MACH64VT
;
}
else
{
fix
->
mmio_start
=
info
->
ati_regbase_phys
-
0x400
)
;
fix
->
mmio_start
=
info
->
ati_regbase_phys
-
0x400
;
fix
->
mmio_len
=
0x800
;
fix
->
accel
=
FB_ACCEL_ATI_MACH64GT
;
}
...
...
drivers/video/modedb.c
0 → 100644
View file @
93ef77fa
This diff is collapsed.
Click to expand it.
include/linux/ioport.h
View file @
93ef77fa
...
...
@@ -8,19 +8,6 @@
#ifndef _LINUX_IOPORT_H
#define _LINUX_IOPORT_H
#define DEVICE_IO_NOTSET (~0)
#define DEVICE_IO_AUTO ((~0)-1)
#define DEVICE_IO_FLAG_WRITEABLE (1<<0)
#define DEVICE_IO_FLAG_CACHEABLE (1<<1)
#define DEVICE_IO_FLAG_RANGELENGTH (1<<2)
#define DEVICE_IO_FLAG_SHADOWABLE (1<<4)
#define DEVICE_IO_FLAG_EXPANSIONROM (1<<5)
#define DEVICE_IO_TYPE_8BIT 0
#define DEVICE_IO_TYPE_16BIT 1
#define DEVICE_IO_TYPE_8AND16BIT 2
/*
* Resources are tree-like, allowing
* nesting etc..
...
...
@@ -29,22 +16,29 @@ struct resource {
const
char
*
name
;
unsigned
long
start
,
end
;
unsigned
long
flags
;
unsigned
char
bits
;
/* decoded bits */
unsigned
char
fixed
;
/* fixed range */
unsigned
short
hw_flags
;
/* hardware flags */
unsigned
short
type
;
/* region type */
struct
resource
*
parent
,
*
sibling
,
*
child
;
};
/*
* PCI-like IO resources have these defined flags.
* The low four bits come directly from the PCI specs,
* the rest are extended sw flags..
* IO resources have these defined flags.
*/
#define IORESOURCE_IOPORT 0x01
/* 0 - memory mapped, 1 - IO ports */
#define IORESOURCE_MEMTYPE_MASK 0x06
/* PCI-specific mapping info */
#define IORESOURCE_PREFETCH 0x08
/* No side effects */
#define IORESOURCE_BUSY 0x10
/* Driver uses this resource */
#define IORESOURCE_BITS 0x000000ff
/* Bus-specific bits */
#define IORESOURCE_IO 0x00000100
/* Resource type */
#define IORESOURCE_MEM 0x00000200
#define IORESOURCE_IRQ 0x00000400
#define IORESOURCE_DMA 0x00000800
#define IORESOURCE_PREFETCH 0x00001000
/* No side effects */
#define IORESOURCE_READONLY 0x00002000
#define IORESOURCE_CACHEABLE 0x00004000
#define IORESOURCE_RANGELENGTH 0x00008000
#define IORESOURCE_SHADOWABLE 0x00010000
#define IORESOURCE_UNSET 0x00020000
#define IORESOURCE_AUTO 0x00040000
#define IORESOURCE_BUSY 0x80000000
/* Driver has marked this resource busy */
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
extern
struct
resource
ioport_resource
;
...
...
include/linux/isapnp.h
View file @
93ef77fa
...
...
@@ -24,6 +24,19 @@
#include <linux/config.h>
#define ISAPNP_NOTSET (~0)
#define ISAPNP_AUTO ((~0)-1)
#define ISAPNP_FLAG_WRITEABLE (1<<0)
#define ISAPNP_FLAG_CACHEABLE (1<<1)
#define ISAPNP_FLAG_RANGELENGTH (1<<2)
#define ISAPNP_FLAG_SHADOWABLE (1<<4)
#define ISAPNP_FLAG_EXPANSIONROM (1<<5)
#define ISAPNP_TYPE_8BIT 0
#define ISAPNP_TYPE_16BIT 1
#define ISAPNP_TYPE_8AND16BIT 2
/*
* Configuration registers (TODO: change by specification)
*/
...
...
include/linux/pci.h
View file @
93ef77fa
...
...
@@ -1209,6 +1209,7 @@
#include <linux/ioport.h>
#define DEVICE_COUNT_COMPATIBLE 4
#define DEVICE_COUNT_IRQ 2
#define DEVICE_COUNT_DMA 2
#define DEVICE_COUNT_RESOURCE 12
...
...
@@ -1276,19 +1277,15 @@ struct pci_dev {
* necessary. The field must not be 0 unless the device
* cannot generate interrupts at all.
*/
unsigned
int
irq
;
/* irq generated by this device */
unsigned
short
irq_flags
;
/* irq type */
unsigned
int
irq2
;
unsigned
short
irq2_flags
;
unsigned
char
dma
[
DEVICE_COUNT_DMA
];
unsigned
char
dma_type
[
DEVICE_COUNT_DMA
];
unsigned
char
dma_flags
[
DEVICE_COUNT_DMA
];
unsigned
char
dma_speed
[
DEVICE_COUNT_DMA
];
/* Base registers for this device, can be adjusted by
unsigned
int
irq
;
/*
* Base registers for this device, can be adjusted by
* pcibios_fixup() as necessary.
*/
struct
resource
resource
[
DEVICE_COUNT_RESOURCE
];
struct
resource
dma_resource
[
DEVICE_COUNT_DMA
];
struct
resource
irq_resource
[
DEVICE_COUNT_IRQ
];
unsigned
long
rom_address
;
int
(
*
prepare
)(
struct
pci_dev
*
dev
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment