Loading Documentation/powerpc/booting-without-of.txt +2 −4 Original line number Diff line number Diff line Loading @@ -1645,8 +1645,7 @@ platforms are moved over to use the flattened-device-tree model. - device_type : should be "network", "hldc", "uart", "transparent" "bisync", "atm", or "serial". - compatible : could be "ucc_geth" or "fsl_atm" and so on. - model : should be "UCC". - device-id : the ucc number(1-8), corresponding to UCCx in UM. - cell-index : the ucc number(1-8), corresponding to UCCx in UM. - reg : Offset and length of the register set for the device - interrupts : <a b> where a is the interrupt number and b is a field that represents an encoding of the sense and level Loading Loading @@ -1699,8 +1698,7 @@ platforms are moved over to use the flattened-device-tree model. ucc@2000 { device_type = "network"; compatible = "ucc_geth"; model = "UCC"; device-id = <1>; cell-index = <1>; reg = <2000 200>; interrupts = <a0 0>; interrupt-parent = <700>; Loading arch/powerpc/Kconfig +5 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,11 @@ config FSL_PCI config 4xx_SOC bool config FSL_LBC bool help Freescale Localbus support # Yes MCA RS/6000s exist but Linux-PPC does not currently support any config MCA bool Loading arch/powerpc/Kconfig.debug +1 −1 Original line number Diff line number Diff line Loading @@ -269,7 +269,7 @@ config PPC_EARLY_DEBUG_CPM_ADDR hex "CPM UART early debug transmit descriptor address" depends on PPC_EARLY_DEBUG_CPM default "0xfa202008" if PPC_EP88XC default "0xf0000008" if CPM2 default "0xf0001ff8" if CPM2 default "0xff002008" if CPM1 help This specifies the address of the transmit descriptor Loading arch/powerpc/boot/cpm-serial.c +71 −46 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include "types.h" #include "io.h" #include "ops.h" #include "page.h" struct cpm_scc { u32 gsmrl; Loading Loading @@ -42,6 +43,22 @@ struct cpm_param { u16 tbase; u8 rfcr; u8 tfcr; u16 mrblr; u32 rstate; u8 res1[4]; u16 rbptr; u8 res2[6]; u32 tstate; u8 res3[4]; u16 tbptr; u8 res4[6]; u16 maxidl; u16 idlc; u16 brkln; u16 brkec; u16 brkcr; u16 rmask; u8 res5[4]; }; struct cpm_bd { Loading @@ -54,10 +71,10 @@ static void *cpcr; static struct cpm_param *param; static struct cpm_smc *smc; static struct cpm_scc *scc; struct cpm_bd *tbdf, *rbdf; static struct cpm_bd *tbdf, *rbdf; static u32 cpm_cmd; static u8 *muram_start; static u32 muram_offset; static void *cbd_addr; static u32 cbd_offset; static void (*do_cmd)(int op); static void (*enable_port)(void); Loading Loading @@ -119,20 +136,25 @@ static int cpm_serial_open(void) out_8(¶m->rfcr, 0x10); out_8(¶m->tfcr, 0x10); rbdf = (struct cpm_bd *)muram_start; rbdf->addr = (u8 *)(rbdf + 2); out_be16(¶m->mrblr, 1); out_be16(¶m->maxidl, 0); out_be16(¶m->brkec, 0); out_be16(¶m->brkln, 0); out_be16(¶m->brkcr, 0); rbdf = cbd_addr; rbdf->addr = (u8 *)rbdf - 1; rbdf->sc = 0xa000; rbdf->len = 1; tbdf = rbdf + 1; tbdf->addr = (u8 *)(rbdf + 2) + 1; tbdf->addr = (u8 *)rbdf - 2; tbdf->sc = 0x2000; tbdf->len = 1; sync(); out_be16(¶m->rbase, muram_offset); out_be16(¶m->tbase, muram_offset + sizeof(struct cpm_bd)); out_be16(¶m->rbase, cbd_offset); out_be16(¶m->tbase, cbd_offset + sizeof(struct cpm_bd)); do_cmd(CPM_CMD_INIT_RX_TX); Loading Loading @@ -175,10 +197,12 @@ static unsigned char cpm_serial_getc(void) int cpm_console_init(void *devp, struct serial_console_data *scdp) { void *reg_virt[2]; int is_smc = 0, is_cpm2 = 0, n; unsigned long reg_phys; void *vreg[2]; u32 reg[2]; int is_smc = 0, is_cpm2 = 0; void *parent, *muram; void *muram_addr; unsigned long muram_offset, muram_size; if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) { is_smc = 1; Loading @@ -202,63 +226,64 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp) else do_cmd = cpm1_cmd; n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4); if (n < 4) if (getprop(devp, "fsl,cpm-command", &cpm_cmd, 4) < 4) return -1; n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt)); if (n < (int)sizeof(reg_virt)) { for (n = 0; n < 2; n++) { if (!dt_xlate_reg(devp, n, ®_phys, NULL)) if (dt_get_virtual_reg(devp, vreg, 2) < 2) return -1; reg_virt[n] = (void *)reg_phys; } } if (is_smc) smc = reg_virt[0]; smc = vreg[0]; else scc = reg_virt[0]; scc = vreg[0]; param = reg_virt[1]; param = vreg[1]; parent = get_parent(devp); if (!parent) return -1; n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt)); if (n < (int)sizeof(reg_virt)) { if (!dt_xlate_reg(parent, 0, ®_phys, NULL)) if (dt_get_virtual_reg(parent, &cpcr, 1) < 1) return -1; reg_virt[0] = (void *)reg_phys; } cpcr = reg_virt[0]; muram = finddevice("/soc/cpm/muram/data"); if (!muram) return -1; /* For bootwrapper-compatible device trees, we assume that the first * entry has at least 18 bytes, and that #address-cells/#data-cells * entry has at least 128 bytes, and that #address-cells/#data-cells * is one for both parent and child. */ n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt)); if (n < (int)sizeof(reg_virt)) { if (!dt_xlate_reg(muram, 0, ®_phys, NULL)) if (dt_get_virtual_reg(muram, &muram_addr, 1) < 1) return -1; reg_virt[0] = (void *)reg_phys; } if (getprop(muram, "reg", reg, 8) < 8) return -1; muram_start = reg_virt[0]; muram_offset = reg[0]; muram_size = reg[1]; n = getprop(muram, "reg", &muram_offset, 4); if (n < 4) return -1; /* Store the buffer descriptors at the end of the first muram chunk. * For SMC ports on CPM2-based platforms, relocate the parameter RAM * just before the buffer descriptors. */ cbd_offset = muram_offset + muram_size - 2 * sizeof(struct cpm_bd); if (is_cpm2 && is_smc) { u16 *smc_base = (u16 *)param; u16 pram_offset; pram_offset = cbd_offset - 64; pram_offset = _ALIGN_DOWN(pram_offset, 64); disable_port(); out_be16(smc_base, pram_offset); param = muram_addr - muram_offset + pram_offset; } cbd_addr = muram_addr - muram_offset + cbd_offset; scdp->open = cpm_serial_open; scdp->putc = cpm_serial_putc; Loading arch/powerpc/boot/cuboot-pq2.c +19 −8 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ static void fixup_pci(void) u8 *soc_regs; int i, len; void *node, *parent_node; u32 naddr, nsize, mem_log2; u32 naddr, nsize, mem_pow2, mem_mask; node = finddevice("/pci"); if (!node || !dt_is_compatible(node, "fsl,pq2-pci")) Loading @@ -141,7 +141,7 @@ static void fixup_pci(void) soc_regs = (u8 *)fsl_get_immr(); if (!soc_regs) goto err; goto unhandled; dt_get_reg_format(node, &naddr, &nsize); if (naddr != 3 || nsize != 2) Loading @@ -153,7 +153,7 @@ static void fixup_pci(void) dt_get_reg_format(parent_node, &naddr, &nsize); if (naddr != 1 || nsize != 1) goto err; goto unhandled; len = getprop(node, "ranges", pci_ranges_buf, sizeof(pci_ranges_buf)); Loading @@ -170,14 +170,20 @@ static void fixup_pci(void) } if (!mem || !mmio || !io) goto err; goto unhandled; if (mem->size[1] != mmio->size[1]) goto unhandled; if (mem->size[1] & (mem->size[1] - 1)) goto unhandled; if (io->size[1] & (io->size[1] - 1)) goto unhandled; if (mem->phys_addr + mem->size[1] == mmio->phys_addr) mem_base = mem; else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr) mem_base = mmio; else goto err; goto unhandled; out_be32(&pci_regs[1][0], mem_base->phys_addr | 1); out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1)); Loading @@ -201,8 +207,9 @@ static void fixup_pci(void) out_le32(&pci_regs[0][58], 0); out_le32(&pci_regs[0][60], 0); mem_log2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1); out_le32(&pci_regs[0][62], 0xa0000000 | ~((1 << (mem_log2 - 12)) - 1)); mem_pow2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1); mem_mask = ~(mem_pow2 - 1) >> 12; out_le32(&pci_regs[0][62], 0xa0000000 | mem_mask); /* If PCI is disabled, drive RST high to enable. */ if (!(in_le32(&pci_regs[0][32]) & 1)) { Loading @@ -228,7 +235,11 @@ static void fixup_pci(void) return; err: printf("Bad PCI node\r\n"); printf("Bad PCI node -- using existing firmware setup.\r\n"); return; unhandled: printf("Unsupported PCI node -- using existing firmware setup.\r\n"); } static void pq2_platform_fixups(void) Loading Loading
Documentation/powerpc/booting-without-of.txt +2 −4 Original line number Diff line number Diff line Loading @@ -1645,8 +1645,7 @@ platforms are moved over to use the flattened-device-tree model. - device_type : should be "network", "hldc", "uart", "transparent" "bisync", "atm", or "serial". - compatible : could be "ucc_geth" or "fsl_atm" and so on. - model : should be "UCC". - device-id : the ucc number(1-8), corresponding to UCCx in UM. - cell-index : the ucc number(1-8), corresponding to UCCx in UM. - reg : Offset and length of the register set for the device - interrupts : <a b> where a is the interrupt number and b is a field that represents an encoding of the sense and level Loading Loading @@ -1699,8 +1698,7 @@ platforms are moved over to use the flattened-device-tree model. ucc@2000 { device_type = "network"; compatible = "ucc_geth"; model = "UCC"; device-id = <1>; cell-index = <1>; reg = <2000 200>; interrupts = <a0 0>; interrupt-parent = <700>; Loading
arch/powerpc/Kconfig +5 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,11 @@ config FSL_PCI config 4xx_SOC bool config FSL_LBC bool help Freescale Localbus support # Yes MCA RS/6000s exist but Linux-PPC does not currently support any config MCA bool Loading
arch/powerpc/Kconfig.debug +1 −1 Original line number Diff line number Diff line Loading @@ -269,7 +269,7 @@ config PPC_EARLY_DEBUG_CPM_ADDR hex "CPM UART early debug transmit descriptor address" depends on PPC_EARLY_DEBUG_CPM default "0xfa202008" if PPC_EP88XC default "0xf0000008" if CPM2 default "0xf0001ff8" if CPM2 default "0xff002008" if CPM1 help This specifies the address of the transmit descriptor Loading
arch/powerpc/boot/cpm-serial.c +71 −46 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include "types.h" #include "io.h" #include "ops.h" #include "page.h" struct cpm_scc { u32 gsmrl; Loading Loading @@ -42,6 +43,22 @@ struct cpm_param { u16 tbase; u8 rfcr; u8 tfcr; u16 mrblr; u32 rstate; u8 res1[4]; u16 rbptr; u8 res2[6]; u32 tstate; u8 res3[4]; u16 tbptr; u8 res4[6]; u16 maxidl; u16 idlc; u16 brkln; u16 brkec; u16 brkcr; u16 rmask; u8 res5[4]; }; struct cpm_bd { Loading @@ -54,10 +71,10 @@ static void *cpcr; static struct cpm_param *param; static struct cpm_smc *smc; static struct cpm_scc *scc; struct cpm_bd *tbdf, *rbdf; static struct cpm_bd *tbdf, *rbdf; static u32 cpm_cmd; static u8 *muram_start; static u32 muram_offset; static void *cbd_addr; static u32 cbd_offset; static void (*do_cmd)(int op); static void (*enable_port)(void); Loading Loading @@ -119,20 +136,25 @@ static int cpm_serial_open(void) out_8(¶m->rfcr, 0x10); out_8(¶m->tfcr, 0x10); rbdf = (struct cpm_bd *)muram_start; rbdf->addr = (u8 *)(rbdf + 2); out_be16(¶m->mrblr, 1); out_be16(¶m->maxidl, 0); out_be16(¶m->brkec, 0); out_be16(¶m->brkln, 0); out_be16(¶m->brkcr, 0); rbdf = cbd_addr; rbdf->addr = (u8 *)rbdf - 1; rbdf->sc = 0xa000; rbdf->len = 1; tbdf = rbdf + 1; tbdf->addr = (u8 *)(rbdf + 2) + 1; tbdf->addr = (u8 *)rbdf - 2; tbdf->sc = 0x2000; tbdf->len = 1; sync(); out_be16(¶m->rbase, muram_offset); out_be16(¶m->tbase, muram_offset + sizeof(struct cpm_bd)); out_be16(¶m->rbase, cbd_offset); out_be16(¶m->tbase, cbd_offset + sizeof(struct cpm_bd)); do_cmd(CPM_CMD_INIT_RX_TX); Loading Loading @@ -175,10 +197,12 @@ static unsigned char cpm_serial_getc(void) int cpm_console_init(void *devp, struct serial_console_data *scdp) { void *reg_virt[2]; int is_smc = 0, is_cpm2 = 0, n; unsigned long reg_phys; void *vreg[2]; u32 reg[2]; int is_smc = 0, is_cpm2 = 0; void *parent, *muram; void *muram_addr; unsigned long muram_offset, muram_size; if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) { is_smc = 1; Loading @@ -202,63 +226,64 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp) else do_cmd = cpm1_cmd; n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4); if (n < 4) if (getprop(devp, "fsl,cpm-command", &cpm_cmd, 4) < 4) return -1; n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt)); if (n < (int)sizeof(reg_virt)) { for (n = 0; n < 2; n++) { if (!dt_xlate_reg(devp, n, ®_phys, NULL)) if (dt_get_virtual_reg(devp, vreg, 2) < 2) return -1; reg_virt[n] = (void *)reg_phys; } } if (is_smc) smc = reg_virt[0]; smc = vreg[0]; else scc = reg_virt[0]; scc = vreg[0]; param = reg_virt[1]; param = vreg[1]; parent = get_parent(devp); if (!parent) return -1; n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt)); if (n < (int)sizeof(reg_virt)) { if (!dt_xlate_reg(parent, 0, ®_phys, NULL)) if (dt_get_virtual_reg(parent, &cpcr, 1) < 1) return -1; reg_virt[0] = (void *)reg_phys; } cpcr = reg_virt[0]; muram = finddevice("/soc/cpm/muram/data"); if (!muram) return -1; /* For bootwrapper-compatible device trees, we assume that the first * entry has at least 18 bytes, and that #address-cells/#data-cells * entry has at least 128 bytes, and that #address-cells/#data-cells * is one for both parent and child. */ n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt)); if (n < (int)sizeof(reg_virt)) { if (!dt_xlate_reg(muram, 0, ®_phys, NULL)) if (dt_get_virtual_reg(muram, &muram_addr, 1) < 1) return -1; reg_virt[0] = (void *)reg_phys; } if (getprop(muram, "reg", reg, 8) < 8) return -1; muram_start = reg_virt[0]; muram_offset = reg[0]; muram_size = reg[1]; n = getprop(muram, "reg", &muram_offset, 4); if (n < 4) return -1; /* Store the buffer descriptors at the end of the first muram chunk. * For SMC ports on CPM2-based platforms, relocate the parameter RAM * just before the buffer descriptors. */ cbd_offset = muram_offset + muram_size - 2 * sizeof(struct cpm_bd); if (is_cpm2 && is_smc) { u16 *smc_base = (u16 *)param; u16 pram_offset; pram_offset = cbd_offset - 64; pram_offset = _ALIGN_DOWN(pram_offset, 64); disable_port(); out_be16(smc_base, pram_offset); param = muram_addr - muram_offset + pram_offset; } cbd_addr = muram_addr - muram_offset + cbd_offset; scdp->open = cpm_serial_open; scdp->putc = cpm_serial_putc; Loading
arch/powerpc/boot/cuboot-pq2.c +19 −8 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ static void fixup_pci(void) u8 *soc_regs; int i, len; void *node, *parent_node; u32 naddr, nsize, mem_log2; u32 naddr, nsize, mem_pow2, mem_mask; node = finddevice("/pci"); if (!node || !dt_is_compatible(node, "fsl,pq2-pci")) Loading @@ -141,7 +141,7 @@ static void fixup_pci(void) soc_regs = (u8 *)fsl_get_immr(); if (!soc_regs) goto err; goto unhandled; dt_get_reg_format(node, &naddr, &nsize); if (naddr != 3 || nsize != 2) Loading @@ -153,7 +153,7 @@ static void fixup_pci(void) dt_get_reg_format(parent_node, &naddr, &nsize); if (naddr != 1 || nsize != 1) goto err; goto unhandled; len = getprop(node, "ranges", pci_ranges_buf, sizeof(pci_ranges_buf)); Loading @@ -170,14 +170,20 @@ static void fixup_pci(void) } if (!mem || !mmio || !io) goto err; goto unhandled; if (mem->size[1] != mmio->size[1]) goto unhandled; if (mem->size[1] & (mem->size[1] - 1)) goto unhandled; if (io->size[1] & (io->size[1] - 1)) goto unhandled; if (mem->phys_addr + mem->size[1] == mmio->phys_addr) mem_base = mem; else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr) mem_base = mmio; else goto err; goto unhandled; out_be32(&pci_regs[1][0], mem_base->phys_addr | 1); out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1)); Loading @@ -201,8 +207,9 @@ static void fixup_pci(void) out_le32(&pci_regs[0][58], 0); out_le32(&pci_regs[0][60], 0); mem_log2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1); out_le32(&pci_regs[0][62], 0xa0000000 | ~((1 << (mem_log2 - 12)) - 1)); mem_pow2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1); mem_mask = ~(mem_pow2 - 1) >> 12; out_le32(&pci_regs[0][62], 0xa0000000 | mem_mask); /* If PCI is disabled, drive RST high to enable. */ if (!(in_le32(&pci_regs[0][32]) & 1)) { Loading @@ -228,7 +235,11 @@ static void fixup_pci(void) return; err: printf("Bad PCI node\r\n"); printf("Bad PCI node -- using existing firmware setup.\r\n"); return; unhandled: printf("Unsupported PCI node -- using existing firmware setup.\r\n"); } static void pq2_platform_fixups(void) Loading