Hi,
this diff allows the sili(4) SATA controller found on Octeon II machines
to attach.
This is not a final diff, I want to remove the #if 0 block completely
and prehaps keep the size vs. addr type changes.
What do you think?
Index: include/bus.h
===================================================================
RCS file: /cvs/src/sys/arch/octeon/include/bus.h,v
retrieving revision 1.6
diff -u -p -r1.6 bus.h
--- include/bus.h 29 Mar 2014 18:09:30 -0000 1.6
+++ include/bus.h 5 Aug 2015 17:46:56 -0000
@@ -140,7 +140,7 @@ bus_space_read_multi(8,64)
#define bus_space_read_region(n,m) \
static __inline void \
CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
- bus_addr_t ba, CAT3(u_int,m,_t) *x, size_t cnt) \
+ bus_size_t ba, CAT3(u_int,m,_t) *x, size_t cnt) \
{ \
while (cnt--) \
*x++ = CAT(bus_space_read_,n)(bst, bsh, ba++); \
@@ -151,12 +151,13 @@ bus_space_read_region(2,16)
bus_space_read_region(4,32)
bus_space_read_region(8,64)
+#if 0
/*----------------------------------------------------------------------------*/
#define bus_space_read_raw_region(n,m) \
static __inline void \
CAT(bus_space_read_raw_region_,n)(bus_space_tag_t bst, \
bus_space_handle_t bsh, \
- bus_addr_t ba, u_int8_t *x, size_t cnt) \
+ bus_size_t ba, u_int8_t *x, size_t cnt) \
{ \
cnt >>= ((n) >> 1); \
while (cnt--) { \
@@ -169,6 +170,15 @@ CAT(bus_space_read_raw_region_,n)(bus_sp
bus_space_read_raw_region(2,16)
bus_space_read_raw_region(4,32)
bus_space_read_raw_region(8,64)
+#endif
+
+#define bus_space_read_raw_region_2(t, h, o, a, c) \
+ bus_space_read_region_2((t), (h), (o), (u_int16_t *)(a), (c) >> 1)
+#define bus_space_read_raw_region_4(t, h, o, a, c) \
+ bus_space_read_region_4((t), (h), (o), (u_int32_t *)(a), (c) >> 2)
+#define bus_space_read_raw_region_8(_t, _h, _o, _a, _c) \
+ ((_t)->read_region_8((_h), (_o), (u_int64_t *)(_a), (_c) >> 3))
+
/*----------------------------------------------------------------------------*/
#define bus_space_write_multi(n,m) \
Index: conf/GENERIC
===================================================================
RCS file: /cvs/src/sys/arch/octeon/conf/GENERIC,v
retrieving revision 1.22
diff -u -p -r1.22 GENERIC
--- conf/GENERIC 20 Jul 2015 19:44:32 -0000 1.22
+++ conf/GENERIC 5 Aug 2015 17:46:56 -0000
@@ -73,3 +73,5 @@ umass* at uhub?
scsibus* at scsi?
sd* at scsibus?
+
+sili* at pci? # Silicon Image 3124/3132/3531 SATA