Commit 0854ba5f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

David writes:
  "Sparc fixes:

   1) Minor fallthru comment tweaks from Gustavo A. R. Silva.

   2) VLA removal from Kees Cook.

   3) Make sparc vdso Makefile match x86, from Masahiro Yamada.

   4) Fix clock divider programming in mach64 driver, from Mikulas
      Patocka."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: fix fall-through annotation
  sparc32: fix fall-through annotation
  sparc: vdso: clean-up vdso Makefile
  oradax: remove redundant null check before kfree
  sparc64: viohs: Remove VLA usage
  sbus: Use of_get_child_by_name helper
  sparc: Convert to using %pOFn instead of device_node.name
  mach64: detect the dot clock divider correctly on sparc
parents 0238df64 b7dc10b6
...@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev) ...@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev)
auxio_devtype = AUXIO_TYPE_SBUS; auxio_devtype = AUXIO_TYPE_SBUS;
size = 1; size = 1;
} else { } else {
printk("auxio: Unknown parent bus type [%s]\n", printk("auxio: Unknown parent bus type [%pOFn]\n",
dp->parent->name); dp->parent);
return -ENODEV; return -ENODEV;
} }
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio"); auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
......
...@@ -122,7 +122,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, ...@@ -122,7 +122,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
linux_regs->pc = addr; linux_regs->pc = addr;
linux_regs->npc = addr + 4; linux_regs->npc = addr + 4;
} }
/* fallthru */ /* fall through */
case 'D': case 'D':
case 'k': case 'k':
......
...@@ -148,7 +148,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, ...@@ -148,7 +148,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
linux_regs->tpc = addr; linux_regs->tpc = addr;
linux_regs->tnpc = addr + 4; linux_regs->tnpc = addr + 4;
} }
/* fallthru */ /* fall through */
case 'D': case 'D':
case 'k': case 'k':
......
...@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op) ...@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op)
power_reg = of_ioremap(res, 0, 0x4, "power"); power_reg = of_ioremap(res, 0, 0x4, "power");
printk(KERN_INFO "%s: Control reg at %llx\n", printk(KERN_INFO "%pOFn: Control reg at %llx\n",
op->dev.of_node->name, res->start); op->dev.of_node, res->start);
if (has_button_interrupt(irq, op->dev.of_node)) { if (has_button_interrupt(irq, op->dev.of_node)) {
if (request_irq(irq, if (request_irq(irq,
......
...@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf) ...@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
return; return;
regs = rprop->value; regs = rprop->value;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
regs->which_io, regs->phys_addr); regs->which_io, regs->phys_addr);
} }
...@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf) ...@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
return; return;
regs = prop->value; regs = prop->value;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
regs->which_io, regs->which_io,
regs->phys_addr); regs->phys_addr);
} }
...@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf) ...@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
devfn = (regs->phys_hi >> 8) & 0xff; devfn = (regs->phys_hi >> 8) & 0xff;
if (devfn & 0x07) { if (devfn & 0x07) {
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
devfn >> 3, devfn >> 3,
devfn & 0x07); devfn & 0x07);
} else { } else {
sprintf(tmp_buf, "%s@%x", sprintf(tmp_buf, "%pOFn@%x",
dp->name, dp,
devfn >> 3); devfn >> 3);
} }
} }
...@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf) ...@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
regs->which_io, regs->phys_addr); regs->which_io, regs->phys_addr);
} }
...@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf) ...@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf)
return; return;
device = prop->value; device = prop->value;
sprintf(tmp_buf, "%s:%d:%d@%x,%x", sprintf(tmp_buf, "%pOFn:%d:%d@%x,%x",
dp->name, *vendor, *device, dp, *vendor, *device,
*intr, reg0); *intr, reg0);
} }
...@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp) ...@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
tmp_buf[0] = '\0'; tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf); __build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0') if (tmp_buf[0] == '\0')
strcpy(tmp_buf, dp->name); snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
n = prom_early_alloc(strlen(tmp_buf) + 1); n = prom_early_alloc(strlen(tmp_buf) + 1);
strcpy(n, tmp_buf); strcpy(n, tmp_buf);
......
...@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf) ...@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
regs = rprop->value; regs = rprop->value;
if (!of_node_is_root(dp->parent)) { if (!of_node_is_root(dp->parent)) {
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
(unsigned int) (regs->phys_addr >> 32UL), (unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL)); (unsigned int) (regs->phys_addr & 0xffffffffUL));
return; return;
...@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf) ...@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
const char *prefix = (type == 0) ? "m" : "i"; const char *prefix = (type == 0) ? "m" : "i";
if (low_bits) if (low_bits)
sprintf(tmp_buf, "%s@%s%x,%x", sprintf(tmp_buf, "%pOFn@%s%x,%x",
dp->name, prefix, dp, prefix,
high_bits, low_bits); high_bits, low_bits);
else else
sprintf(tmp_buf, "%s@%s%x", sprintf(tmp_buf, "%pOFn@%s%x",
dp->name, dp,
prefix, prefix,
high_bits); high_bits);
} else if (type == 12) { } else if (type == 12) {
sprintf(tmp_buf, "%s@%x", sprintf(tmp_buf, "%pOFn@%x",
dp->name, high_bits); dp, high_bits);
} }
} }
...@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf) ...@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
if (!of_node_is_root(dp->parent)) { if (!of_node_is_root(dp->parent)) {
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
(unsigned int) (regs->phys_addr >> 32UL), (unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL)); (unsigned int) (regs->phys_addr & 0xffffffffUL));
return; return;
...@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf) ...@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
if (tlb_type >= cheetah) if (tlb_type >= cheetah)
mask = 0x7fffff; mask = 0x7fffff;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
*(u32 *)prop->value, *(u32 *)prop->value,
(unsigned int) (regs->phys_addr & mask)); (unsigned int) (regs->phys_addr & mask));
} }
...@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf) ...@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
return; return;
regs = prop->value; regs = prop->value;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
regs->which_io, regs->which_io,
regs->phys_addr); regs->phys_addr);
} }
...@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf) ...@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
devfn = (regs->phys_hi >> 8) & 0xff; devfn = (regs->phys_hi >> 8) & 0xff;
if (devfn & 0x07) { if (devfn & 0x07) {
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
devfn >> 3, devfn >> 3,
devfn & 0x07); devfn & 0x07);
} else { } else {
sprintf(tmp_buf, "%s@%x", sprintf(tmp_buf, "%pOFn@%x",
dp->name, dp,
devfn >> 3); devfn >> 3);
} }
} }
...@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf) ...@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf)
if (!prop) if (!prop)
return; return;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
*(u32 *) prop->value, *(u32 *) prop->value,
(unsigned int) (regs->phys_addr & 0xffffffffUL)); (unsigned int) (regs->phys_addr & 0xffffffffUL));
} }
...@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf) ...@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
sprintf(tmp_buf, "%s@%x", dp->name, *regs); sprintf(tmp_buf, "%pOFn@%x", dp, *regs);
} }
/* "name@addrhi,addrlo" */ /* "name@addrhi,addrlo" */
...@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf) ...@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, dp,
(unsigned int) (regs->phys_addr >> 32UL), (unsigned int) (regs->phys_addr >> 32UL),
(unsigned int) (regs->phys_addr & 0xffffffffUL)); (unsigned int) (regs->phys_addr & 0xffffffffUL));
} }
...@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf) ...@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf)
/* This actually isn't right... should look at the #address-cells /* This actually isn't right... should look at the #address-cells
* property of the i2c bus node etc. etc. * property of the i2c bus node etc. etc.
*/ */
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, regs[0], regs[1]); dp, regs[0], regs[1]);
} }
/* "name@reg0[,reg1]" */ /* "name@reg0[,reg1]" */
...@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf) ...@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf)
regs = prop->value; regs = prop->value;
if (prop->length == sizeof(u32) || regs[1] == 1) { if (prop->length == sizeof(u32) || regs[1] == 1) {
sprintf(tmp_buf, "%s@%x", sprintf(tmp_buf, "%pOFn@%x",
dp->name, regs[0]); dp, regs[0]);
} else { } else {
sprintf(tmp_buf, "%s@%x,%x", sprintf(tmp_buf, "%pOFn@%x,%x",
dp->name, regs[0], regs[1]); dp, regs[0], regs[1]);
} }
} }
...@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf ...@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf
regs = prop->value; regs = prop->value;
if (regs[2] || regs[3]) { if (regs[2] || regs[3]) {
sprintf(tmp_buf, "%s@%08x%08x,%04x%08x", sprintf(tmp_buf, "%pOFn@%08x%08x,%04x%08x",
dp->name, regs[0], regs[1], regs[2], regs[3]); dp, regs[0], regs[1], regs[2], regs[3]);
} else { } else {
sprintf(tmp_buf, "%s@%08x%08x", sprintf(tmp_buf, "%pOFn@%08x%08x",
dp->name, regs[0], regs[1]); dp, regs[0], regs[1]);
} }
} }
...@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp) ...@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp)
tmp_buf[0] = '\0'; tmp_buf[0] = '\0';
__build_path_component(dp, tmp_buf); __build_path_component(dp, tmp_buf);
if (tmp_buf[0] == '\0') if (tmp_buf[0] == '\0')
strcpy(tmp_buf, dp->name); snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
n = prom_early_alloc(strlen(tmp_buf) + 1); n = prom_early_alloc(strlen(tmp_buf) + 1);
strcpy(n, tmp_buf); strcpy(n, tmp_buf);
......
...@@ -180,11 +180,17 @@ static int send_dreg(struct vio_driver_state *vio) ...@@ -180,11 +180,17 @@ static int send_dreg(struct vio_driver_state *vio)
struct vio_dring_register pkt; struct vio_dring_register pkt;
char all[sizeof(struct vio_dring_register) + char all[sizeof(struct vio_dring_register) +
(sizeof(struct ldc_trans_cookie) * (sizeof(struct ldc_trans_cookie) *
dr->ncookies)]; VIO_MAX_RING_COOKIES)];
} u; } u;
size_t bytes = sizeof(struct vio_dring_register) +
(sizeof(struct ldc_trans_cookie) *
dr->ncookies);
int i; int i;
memset(&u, 0, sizeof(u)); if (WARN_ON(bytes > sizeof(u)))
return -EINVAL;
memset(&u, 0, bytes);
init_tag(&u.pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_DRING_REG); init_tag(&u.pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_DRING_REG);
u.pkt.dring_ident = 0; u.pkt.dring_ident = 0;
u.pkt.num_descr = dr->num_entries; u.pkt.num_descr = dr->num_entries;
...@@ -206,7 +212,7 @@ static int send_dreg(struct vio_driver_state *vio) ...@@ -206,7 +212,7 @@ static int send_dreg(struct vio_driver_state *vio)
(unsigned long long) u.pkt.cookies[i].cookie_size); (unsigned long long) u.pkt.cookies[i].cookie_size);
} }
return send_ctrl(vio, &u.pkt.tag, sizeof(u)); return send_ctrl(vio, &u.pkt.tag, bytes);
} }
static int send_rdx(struct vio_driver_state *vio) static int send_rdx(struct vio_driver_state *vio)
......
...@@ -31,23 +31,21 @@ obj-y += $(vdso_img_objs) ...@@ -31,23 +31,21 @@ obj-y += $(vdso_img_objs)
targets += $(vdso_img_cfiles) targets += $(vdso_img_cfiles)
targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so) targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
export CPPFLAGS_vdso.lds += -P -C CPPFLAGS_vdso.lds += -P -C
VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \ VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
-Wl,--no-undefined \ -Wl,--no-undefined \
-Wl,-z,max-page-size=8192 -Wl,-z,common-page-size=8192 \ -Wl,-z,max-page-size=8192 -Wl,-z,common-page-size=8192 \
$(DISABLE_LTO) $(DISABLE_LTO)
$(obj)/vdso64.so.dbg: $(src)/vdso.lds $(vobjs) FORCE $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
$(call if_changed,vdso) $(call if_changed,vdso)
HOST_EXTRACFLAGS += -I$(srctree)/tools/include HOST_EXTRACFLAGS += -I$(srctree)/tools/include
hostprogs-y += vdso2c hostprogs-y += vdso2c
quiet_cmd_vdso2c = VDSO2C $@ quiet_cmd_vdso2c = VDSO2C $@
define cmd_vdso2c cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
$(obj)/vdso2c $< $(<:%.dbg=%) $@
endef
$(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
$(call if_changed,vdso2c) $(call if_changed,vdso2c)
......
...@@ -715,22 +715,13 @@ static struct miscdevice openprom_dev = { ...@@ -715,22 +715,13 @@ static struct miscdevice openprom_dev = {
static int __init openprom_init(void) static int __init openprom_init(void)
{ {
struct device_node *dp;
int err; int err;
err = misc_register(&openprom_dev); err = misc_register(&openprom_dev);
if (err) if (err)
return err; return err;
dp = of_find_node_by_path("/"); options_node = of_get_child_by_name(of_find_node_by_path("/"), "options");
dp = dp->child;
while (dp) {
if (!strcmp(dp->name, "options"))
break;
dp = dp->sibling;
}
options_node = dp;
if (!options_node) { if (!options_node) {
misc_deregister(&openprom_dev); misc_deregister(&openprom_dev);
return -EIO; return -EIO;
......
...@@ -689,8 +689,7 @@ static int dax_open(struct inode *inode, struct file *f) ...@@ -689,8 +689,7 @@ static int dax_open(struct inode *inode, struct file *f)
alloc_error: alloc_error:
kfree(ctx->ccb_buf); kfree(ctx->ccb_buf);
done: done:
if (ctx != NULL) kfree(ctx);
kfree(ctx);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -333,6 +333,8 @@ extern const struct aty_pll_ops aty_pll_ct; /* Integrated */ ...@@ -333,6 +333,8 @@ extern const struct aty_pll_ops aty_pll_ct; /* Integrated */
extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll); extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll);
extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par); extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
extern const u8 aty_postdividers[8];
/* /*
* Hardware cursor support * Hardware cursor support
...@@ -359,7 +361,6 @@ static inline void wait_for_idle(struct atyfb_par *par) ...@@ -359,7 +361,6 @@ static inline void wait_for_idle(struct atyfb_par *par)
extern void aty_reset_engine(const struct atyfb_par *par); extern void aty_reset_engine(const struct atyfb_par *par);
extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info); extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info);
extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
......
...@@ -3087,17 +3087,18 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info, ...@@ -3087,17 +3087,18 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info,
/* /*
* PLL Reference Divider M: * PLL Reference Divider M:
*/ */
M = pll_regs[2]; M = pll_regs[PLL_REF_DIV];
/* /*
* PLL Feedback Divider N (Dependent on CLOCK_CNTL): * PLL Feedback Divider N (Dependent on CLOCK_CNTL):
*/ */
N = pll_regs[7 + (clock_cntl & 3)]; N = pll_regs[VCLK0_FB_DIV + (clock_cntl & 3)];
/* /*
* PLL Post Divider P (Dependent on CLOCK_CNTL): * PLL Post Divider P (Dependent on CLOCK_CNTL):
*/ */
P = 1 << (pll_regs[6] >> ((clock_cntl & 3) << 1)); P = aty_postdividers[((pll_regs[VCLK_POST_DIV] >> ((clock_cntl & 3) << 1)) & 3) |
((pll_regs[PLL_EXT_CNTL] >> (2 + (clock_cntl & 3))) & 4)];
/* /*
* PLL Divider Q: * PLL Divider Q:
......
...@@ -115,7 +115,7 @@ static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par) ...@@ -115,7 +115,7 @@ static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par)
*/ */
#define Maximum_DSP_PRECISION 7 #define Maximum_DSP_PRECISION 7
static u8 postdividers[] = {1,2,4,8,3}; const u8 aty_postdividers[8] = {1,2,4,8,3,5,6,12};
static int aty_dsp_gt(const struct fb_info *info, u32 bpp, struct pll_ct *pll) static int aty_dsp_gt(const struct fb_info *info, u32 bpp, struct pll_ct *pll)
{ {
...@@ -222,7 +222,7 @@ static int aty_valid_pll_ct(const struct fb_info *info, u32 vclk_per, struct pll ...@@ -222,7 +222,7 @@ static int aty_valid_pll_ct(const struct fb_info *info, u32 vclk_per, struct pll
pll->vclk_post_div += (q < 64*8); pll->vclk_post_div += (q < 64*8);
pll->vclk_post_div += (q < 32*8); pll->vclk_post_div += (q < 32*8);
} }
pll->vclk_post_div_real = postdividers[pll->vclk_post_div]; pll->vclk_post_div_real = aty_postdividers[pll->vclk_post_div];
// pll->vclk_post_div <<= 6; // pll->vclk_post_div <<= 6;
pll->vclk_fb_div = q * pll->vclk_post_div_real / 8; pll->vclk_fb_div = q * pll->vclk_post_div_real / 8;
pllvclk = (1000000 * 2 * pll->vclk_fb_div) / pllvclk = (1000000 * 2 * pll->vclk_fb_div) /
...@@ -513,7 +513,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll) ...@@ -513,7 +513,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
u8 mclk_fb_div, pll_ext_cntl; u8 mclk_fb_div, pll_ext_cntl;
pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par);
pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par); pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par);
pll->ct.xclk_post_div_real = postdividers[pll_ext_cntl & 0x07]; pll->ct.xclk_post_div_real = aty_postdividers[pll_ext_cntl & 0x07];
mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par); mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par);
if (pll_ext_cntl & PLL_MFB_TIMES_4_2B) if (pll_ext_cntl & PLL_MFB_TIMES_4_2B)
mclk_fb_div <<= 1; mclk_fb_div <<= 1;
...@@ -535,7 +535,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll) ...@@ -535,7 +535,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
xpost_div += (q < 64*8); xpost_div += (q < 64*8);
xpost_div += (q < 32*8); xpost_div += (q < 32*8);
} }
pll->ct.xclk_post_div_real = postdividers[xpost_div]; pll->ct.xclk_post_div_real = aty_postdividers[xpost_div];
pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8; pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
...@@ -584,7 +584,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll) ...@@ -584,7 +584,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
mpost_div += (q < 64*8); mpost_div += (q < 64*8);
mpost_div += (q < 32*8); mpost_div += (q < 32*8);
} }
sclk_post_div_real = postdividers[mpost_div]; sclk_post_div_real = aty_postdividers[mpost_div];
pll->ct.sclk_fb_div = q * sclk_post_div_real / 8; pll->ct.sclk_fb_div = q * sclk_post_div_real / 8;
pll->ct.spll_cntl2 = mpost_div << 4; pll->ct.spll_cntl2 = mpost_div << 4;
#ifdef DEBUG #ifdef DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment