Merge branch '3.16-fixes' into mips-for-linux-next
authorRalf Baechle <ralf@linux-mips.org>
Fri, 1 Aug 2014 22:07:03 +0000 (00:07 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 1 Aug 2014 22:07:03 +0000 (00:07 +0200)
1  2 
arch/mips/kernel/ptrace.c
arch/mips/kernel/scall64-n32.S
arch/mips/mm/tlbex.c
arch/mips/rb532/devices.c

index 8c78f01dbe73b1359bc46807ad83b68069887603,3a7f7dd610fd087446d3bb1dbd8ebd1d4afd0374..645b3c4fcfba9ae747f378a54fcbaf797103492b
@@@ -24,6 -24,7 +24,6 @@@
  #include <linux/ptrace.h>
  #include <linux/regset.h>
  #include <linux/smp.h>
 -#include <linux/user.h>
  #include <linux/security.h>
  #include <linux/tracehook.h>
  #include <linux/audit.h>
@@@ -62,7 -63,7 +62,7 @@@ void ptrace_disable(struct task_struct 
   * for 32-bit kernels and for 32-bit processes on a 64-bit kernel.
   * Registers are sign extended to fill the available space.
   */
 -int ptrace_getregs(struct task_struct *child, __s64 __user *data)
 +int ptrace_getregs(struct task_struct *child, struct user_pt_regs __user *data)
  {
        struct pt_regs *regs;
        int i;
        regs = task_pt_regs(child);
  
        for (i = 0; i < 32; i++)
 -              __put_user((long)regs->regs[i], data + i);
 -      __put_user((long)regs->lo, data + EF_LO - EF_R0);
 -      __put_user((long)regs->hi, data + EF_HI - EF_R0);
 -      __put_user((long)regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
 -      __put_user((long)regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
 -      __put_user((long)regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
 -      __put_user((long)regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
 +              __put_user((long)regs->regs[i], (__s64 __user *)&data->regs[i]);
 +      __put_user((long)regs->lo, (__s64 __user *)&data->lo);
 +      __put_user((long)regs->hi, (__s64 __user *)&data->hi);
 +      __put_user((long)regs->cp0_epc, (__s64 __user *)&data->cp0_epc);
 +      __put_user((long)regs->cp0_badvaddr, (__s64 __user *)&data->cp0_badvaddr);
 +      __put_user((long)regs->cp0_status, (__s64 __user *)&data->cp0_status);
 +      __put_user((long)regs->cp0_cause, (__s64 __user *)&data->cp0_cause);
  
        return 0;
  }
@@@ -89,7 -90,7 +89,7 @@@
   * the 64-bit format.  On a 32-bit kernel only the lower order half
   * (according to endianness) will be used.
   */
 -int ptrace_setregs(struct task_struct *child, __s64 __user *data)
 +int ptrace_setregs(struct task_struct *child, struct user_pt_regs __user *data)
  {
        struct pt_regs *regs;
        int i;
        regs = task_pt_regs(child);
  
        for (i = 0; i < 32; i++)
 -              __get_user(regs->regs[i], data + i);
 -      __get_user(regs->lo, data + EF_LO - EF_R0);
 -      __get_user(regs->hi, data + EF_HI - EF_R0);
 -      __get_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
 +              __get_user(regs->regs[i], (__s64 __user *)&data->regs[i]);
 +      __get_user(regs->lo, (__s64 __user *)&data->lo);
 +      __get_user(regs->hi, (__s64 __user *)&data->hi);
 +      __get_user(regs->cp0_epc, (__s64 __user *)&data->cp0_epc);
  
        /* badvaddr, status, and cause may not be written.  */
  
@@@ -128,7 -129,7 +128,7 @@@ int ptrace_getfpregs(struct task_struc
        }
  
        __put_user(child->thread.fpu.fcr31, data + 64);
 -      __put_user(current_cpu_data.fpu_id, data + 65);
 +      __put_user(boot_cpu_data.fpu_id, data + 65);
  
        return 0;
  }
@@@ -150,6 -151,7 +150,7 @@@ int ptrace_setfpregs(struct task_struc
        }
  
        __get_user(child->thread.fpu.fcr31, data + 64);
+       child->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X;
  
        /* FIR may not be written.  */
  
@@@ -245,160 -247,36 +246,160 @@@ int ptrace_set_watch_regs(struct task_s
  
  /* regset get/set implementations */
  
 -static int gpr_get(struct task_struct *target,
 -                 const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count,
 -                 void *kbuf, void __user *ubuf)
 +#if defined(CONFIG_32BIT) || defined(CONFIG_MIPS32_O32)
 +
 +static int gpr32_get(struct task_struct *target,
 +                   const struct user_regset *regset,
 +                   unsigned int pos, unsigned int count,
 +                   void *kbuf, void __user *ubuf)
  {
        struct pt_regs *regs = task_pt_regs(target);
 +      u32 uregs[ELF_NGREG] = {};
 +      unsigned i;
 +
 +      for (i = MIPS32_EF_R1; i <= MIPS32_EF_R31; i++) {
 +              /* k0/k1 are copied as zero. */
 +              if (i == MIPS32_EF_R26 || i == MIPS32_EF_R27)
 +                      continue;
 +
 +              uregs[i] = regs->regs[i - MIPS32_EF_R0];
 +      }
  
 -      return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 -                                 regs, 0, sizeof(*regs));
 +      uregs[MIPS32_EF_LO] = regs->lo;
 +      uregs[MIPS32_EF_HI] = regs->hi;
 +      uregs[MIPS32_EF_CP0_EPC] = regs->cp0_epc;
 +      uregs[MIPS32_EF_CP0_BADVADDR] = regs->cp0_badvaddr;
 +      uregs[MIPS32_EF_CP0_STATUS] = regs->cp0_status;
 +      uregs[MIPS32_EF_CP0_CAUSE] = regs->cp0_cause;
 +
 +      return user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0,
 +                                 sizeof(uregs));
  }
  
 -static int gpr_set(struct task_struct *target,
 -                 const struct user_regset *regset,
 -                 unsigned int pos, unsigned int count,
 -                 const void *kbuf, const void __user *ubuf)
 +static int gpr32_set(struct task_struct *target,
 +                   const struct user_regset *regset,
 +                   unsigned int pos, unsigned int count,
 +                   const void *kbuf, const void __user *ubuf)
  {
 -      struct pt_regs newregs;
 -      int ret;
 +      struct pt_regs *regs = task_pt_regs(target);
 +      u32 uregs[ELF_NGREG];
 +      unsigned start, num_regs, i;
 +      int err;
 +
 +      start = pos / sizeof(u32);
 +      num_regs = count / sizeof(u32);
 +
 +      if (start + num_regs > ELF_NGREG)
 +              return -EIO;
 +
 +      err = user_regset_copyin(&pos, &count, &kbuf, &ubuf, uregs, 0,
 +                               sizeof(uregs));
 +      if (err)
 +              return err;
 +
 +      for (i = start; i < num_regs; i++) {
 +              /*
 +               * Cast all values to signed here so that if this is a 64-bit
 +               * kernel, the supplied 32-bit values will be sign extended.
 +               */
 +              switch (i) {
 +              case MIPS32_EF_R1 ... MIPS32_EF_R25:
 +                      /* k0/k1 are ignored. */
 +              case MIPS32_EF_R28 ... MIPS32_EF_R31:
 +                      regs->regs[i - MIPS32_EF_R0] = (s32)uregs[i];
 +                      break;
 +              case MIPS32_EF_LO:
 +                      regs->lo = (s32)uregs[i];
 +                      break;
 +              case MIPS32_EF_HI:
 +                      regs->hi = (s32)uregs[i];
 +                      break;
 +              case MIPS32_EF_CP0_EPC:
 +                      regs->cp0_epc = (s32)uregs[i];
 +                      break;
 +              }
 +      }
 +
 +      return 0;
 +}
 +
 +#endif /* CONFIG_32BIT || CONFIG_MIPS32_O32 */
 +
 +#ifdef CONFIG_64BIT
 +
 +static int gpr64_get(struct task_struct *target,
 +                   const struct user_regset *regset,
 +                   unsigned int pos, unsigned int count,
 +                   void *kbuf, void __user *ubuf)
 +{
 +      struct pt_regs *regs = task_pt_regs(target);
 +      u64 uregs[ELF_NGREG] = {};
 +      unsigned i;
 +
 +      for (i = MIPS64_EF_R1; i <= MIPS64_EF_R31; i++) {
 +              /* k0/k1 are copied as zero. */
 +              if (i == MIPS64_EF_R26 || i == MIPS64_EF_R27)
 +                      continue;
 +
 +              uregs[i] = regs->regs[i - MIPS64_EF_R0];
 +      }
 +
 +      uregs[MIPS64_EF_LO] = regs->lo;
 +      uregs[MIPS64_EF_HI] = regs->hi;
 +      uregs[MIPS64_EF_CP0_EPC] = regs->cp0_epc;
 +      uregs[MIPS64_EF_CP0_BADVADDR] = regs->cp0_badvaddr;
 +      uregs[MIPS64_EF_CP0_STATUS] = regs->cp0_status;
 +      uregs[MIPS64_EF_CP0_CAUSE] = regs->cp0_cause;
 +
 +      return user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0,
 +                                 sizeof(uregs));
 +}
  
 -      ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 -                               &newregs,
 -                               0, sizeof(newregs));
 -      if (ret)
 -              return ret;
 +static int gpr64_set(struct task_struct *target,
 +                   const struct user_regset *regset,
 +                   unsigned int pos, unsigned int count,
 +                   const void *kbuf, const void __user *ubuf)
 +{
 +      struct pt_regs *regs = task_pt_regs(target);
 +      u64 uregs[ELF_NGREG];
 +      unsigned start, num_regs, i;
 +      int err;
 +
 +      start = pos / sizeof(u64);
 +      num_regs = count / sizeof(u64);
  
 -      *task_pt_regs(target) = newregs;
 +      if (start + num_regs > ELF_NGREG)
 +              return -EIO;
 +
 +      err = user_regset_copyin(&pos, &count, &kbuf, &ubuf, uregs, 0,
 +                               sizeof(uregs));
 +      if (err)
 +              return err;
 +
 +      for (i = start; i < num_regs; i++) {
 +              switch (i) {
 +              case MIPS64_EF_R1 ... MIPS64_EF_R25:
 +                      /* k0/k1 are ignored. */
 +              case MIPS64_EF_R28 ... MIPS64_EF_R31:
 +                      regs->regs[i - MIPS64_EF_R0] = uregs[i];
 +                      break;
 +              case MIPS64_EF_LO:
 +                      regs->lo = uregs[i];
 +                      break;
 +              case MIPS64_EF_HI:
 +                      regs->hi = uregs[i];
 +                      break;
 +              case MIPS64_EF_CP0_EPC:
 +                      regs->cp0_epc = uregs[i];
 +                      break;
 +              }
 +      }
  
        return 0;
  }
  
 +#endif /* CONFIG_64BIT */
 +
  static int fpr_get(struct task_struct *target,
                   const struct user_regset *regset,
                   unsigned int pos, unsigned int count,
@@@ -460,16 -338,14 +461,16 @@@ enum mips_regset 
        REGSET_FPR,
  };
  
 +#if defined(CONFIG_32BIT) || defined(CONFIG_MIPS32_O32)
 +
  static const struct user_regset mips_regsets[] = {
        [REGSET_GPR] = {
                .core_note_type = NT_PRSTATUS,
                .n              = ELF_NGREG,
                .size           = sizeof(unsigned int),
                .align          = sizeof(unsigned int),
 -              .get            = gpr_get,
 -              .set            = gpr_set,
 +              .get            = gpr32_get,
 +              .set            = gpr32_set,
        },
        [REGSET_FPR] = {
                .core_note_type = NT_PRFPREG,
@@@ -489,18 -365,14 +490,18 @@@ static const struct user_regset_view us
        .n              = ARRAY_SIZE(mips_regsets),
  };
  
 +#endif /* CONFIG_32BIT || CONFIG_MIPS32_O32 */
 +
 +#ifdef CONFIG_64BIT
 +
  static const struct user_regset mips64_regsets[] = {
        [REGSET_GPR] = {
                .core_note_type = NT_PRSTATUS,
                .n              = ELF_NGREG,
                .size           = sizeof(unsigned long),
                .align          = sizeof(unsigned long),
 -              .get            = gpr_get,
 -              .set            = gpr_set,
 +              .get            = gpr64_get,
 +              .set            = gpr64_set,
        },
        [REGSET_FPR] = {
                .core_note_type = NT_PRFPREG,
  };
  
  static const struct user_regset_view user_mips64_view = {
 -      .name           = "mips",
 +      .name           = "mips64",
        .e_machine      = ELF_ARCH,
        .ei_osabi       = ELF_OSABI,
        .regsets        = mips64_regsets,
 -      .n              = ARRAY_SIZE(mips_regsets),
 +      .n              = ARRAY_SIZE(mips64_regsets),
  };
  
 +#endif /* CONFIG_64BIT */
 +
  const struct user_regset_view *task_user_regset_view(struct task_struct *task)
  {
  #ifdef CONFIG_32BIT
        return &user_mips_view;
 -#endif
 -
 +#else
  #ifdef CONFIG_MIPS32_O32
 -              if (test_thread_flag(TIF_32BIT_REGS))
 -                      return &user_mips_view;
 +      if (test_tsk_thread_flag(task, TIF_32BIT_REGS))
 +              return &user_mips_view;
  #endif
 -
        return &user_mips64_view;
 +#endif
  }
  
  long arch_ptrace(struct task_struct *child, long request,
                        break;
                case FPC_EIR:
                        /* implementation / version register */
 -                      tmp = current_cpu_data.fpu_id;
 +                      tmp = boot_cpu_data.fpu_id;
                        break;
                case DSP_BASE ... DSP_BASE + 5: {
                        dspreg_t *dregs;
                        break;
  #endif
                case FPC_CSR:
-                       child->thread.fpu.fcr31 = data;
+                       child->thread.fpu.fcr31 = data & ~FPU_CSR_ALL_X;
                        break;
                case DSP_BASE ... DSP_BASE + 5: {
                        dspreg_t *dregs;
index 7641c87be99ae1b7d992c9240d3eeaeb67bc6226,e543861ef00ab607a7d7af22b3887f2cb2c34d50..03dec5ae11baf744281a95f7e6ad1748d54c69b2
@@@ -162,7 -162,7 +162,7 @@@ EXPORT(sysn32_call_table
        PTR     sys_getpeername
        PTR     sys_socketpair
        PTR     compat_sys_setsockopt
-       PTR     sys_getsockopt
+       PTR     compat_sys_getsockopt
        PTR     __sys_clone                     /* 6055 */
        PTR     __sys_fork
        PTR     compat_sys_execve
        PTR     compat_sys_clock_nanosleep
        PTR     sys_tgkill
        PTR     compat_sys_utimes               /* 6230 */
 -      PTR     sys_ni_syscall                  /* sys_mbind */
 -      PTR     sys_ni_syscall                  /* sys_get_mempolicy */
 -      PTR     sys_ni_syscall                  /* sys_set_mempolicy */
 +      PTR     compat_sys_mbind
 +      PTR     compat_sys_get_mempolicy
 +      PTR     compat_sys_set_mempolicy
        PTR     compat_sys_mq_open
        PTR     sys_mq_unlink                   /* 6235 */
        PTR     compat_sys_mq_timedsend
        PTR     sys_inotify_init
        PTR     sys_inotify_add_watch
        PTR     sys_inotify_rm_watch
 -      PTR     sys_migrate_pages               /* 6250 */
 +      PTR     compat_sys_migrate_pages        /* 6250 */
        PTR     sys_openat
        PTR     sys_mkdirat
        PTR     sys_mknodat
        PTR     sys_sync_file_range
        PTR     sys_tee
        PTR     compat_sys_vmsplice             /* 6270 */
 -      PTR     sys_move_pages
 +      PTR     compat_sys_move_pages
        PTR     compat_sys_set_robust_list
        PTR     compat_sys_get_robust_list
        PTR     compat_sys_kexec_load
diff --combined arch/mips/mm/tlbex.c
index ccf8298e7ab26bfc62134462087f623a9a896c43,cf8a9525f0fa5c1c1b844cfaf3b7e6ef6e60479b..a08dd53a1cc51a976d4608444d2a1307ce0865ed
@@@ -429,6 -429,7 +429,7 @@@ static void build_r3000_tlb_refill_hand
                 (unsigned int)(p - tlb_handler));
  
        memcpy((void *)ebase, tlb_handler, 0x80);
+       local_flush_icache_range(ebase, ebase + 0x80);
  
        dump_handler("r3000_tlb_refill", (u32 *)ebase, 32);
  }
@@@ -1299,6 -1300,7 +1300,7 @@@ static void build_r4000_tlb_refill_hand
        }
  #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
        uasm_l_tlb_huge_update(&l, p);
+       UASM_i_LW(&p, K0, 0, K1);
        build_huge_update_entries(&p, htlb_info.huge_pte, K1);
        build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random,
                                   htlb_info.restore_scratch);
                 final_len);
  
        memcpy((void *)ebase, final_handler, 0x100);
+       local_flush_icache_range(ebase, ebase + 0x100);
  
        dump_handler("r4000_tlb_refill", (u32 *)ebase, 64);
  }
@@@ -1919,7 -1922,7 +1922,7 @@@ static void build_r4000_tlb_load_handle
        if (m4kc_tlbp_war())
                build_tlb_probe_entry(&p);
  
 -      if (cpu_has_rixi) {
 +      if (cpu_has_rixi && !cpu_has_rixiex) {
                /*
                 * If the page is not _PAGE_VALID, RI or XI could not
                 * have triggered it.  Skip the expensive test..
        build_pte_present(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbl);
        build_tlb_probe_entry(&p);
  
 -      if (cpu_has_rixi) {
 +      if (cpu_has_rixi && !cpu_has_rixiex) {
                /*
                 * If the page is not _PAGE_VALID, RI or XI could not
                 * have triggered it.  Skip the expensive test..
@@@ -2194,94 -2197,6 +2197,94 @@@ static void flush_tlb_handlers(void
                           (unsigned long)tlbmiss_handler_setup_pgd_end);
  }
  
 +static void print_htw_config(void)
 +{
 +      unsigned long config;
 +      unsigned int pwctl;
 +      const int field = 2 * sizeof(unsigned long);
 +
 +      config = read_c0_pwfield();
 +      pr_debug("PWField (0x%0*lx): GDI: 0x%02lx  UDI: 0x%02lx  MDI: 0x%02lx  PTI: 0x%02lx  PTEI: 0x%02lx\n",
 +              field, config,
 +              (config & MIPS_PWFIELD_GDI_MASK) >> MIPS_PWFIELD_GDI_SHIFT,
 +              (config & MIPS_PWFIELD_UDI_MASK) >> MIPS_PWFIELD_UDI_SHIFT,
 +              (config & MIPS_PWFIELD_MDI_MASK) >> MIPS_PWFIELD_MDI_SHIFT,
 +              (config & MIPS_PWFIELD_PTI_MASK) >> MIPS_PWFIELD_PTI_SHIFT,
 +              (config & MIPS_PWFIELD_PTEI_MASK) >> MIPS_PWFIELD_PTEI_SHIFT);
 +
 +      config = read_c0_pwsize();
 +      pr_debug("PWSize  (0x%0*lx): GDW: 0x%02lx  UDW: 0x%02lx  MDW: 0x%02lx  PTW: 0x%02lx  PTEW: 0x%02lx\n",
 +              field, config,
 +              (config & MIPS_PWSIZE_GDW_MASK) >> MIPS_PWSIZE_GDW_SHIFT,
 +              (config & MIPS_PWSIZE_UDW_MASK) >> MIPS_PWSIZE_UDW_SHIFT,
 +              (config & MIPS_PWSIZE_MDW_MASK) >> MIPS_PWSIZE_MDW_SHIFT,
 +              (config & MIPS_PWSIZE_PTW_MASK) >> MIPS_PWSIZE_PTW_SHIFT,
 +              (config & MIPS_PWSIZE_PTEW_MASK) >> MIPS_PWSIZE_PTEW_SHIFT);
 +
 +      pwctl = read_c0_pwctl();
 +      pr_debug("PWCtl   (0x%x): PWEn: 0x%x  DPH: 0x%x  HugePg: 0x%x  Psn: 0x%x\n",
 +              pwctl,
 +              (pwctl & MIPS_PWCTL_PWEN_MASK) >> MIPS_PWCTL_PWEN_SHIFT,
 +              (pwctl & MIPS_PWCTL_DPH_MASK) >> MIPS_PWCTL_DPH_SHIFT,
 +              (pwctl & MIPS_PWCTL_HUGEPG_MASK) >> MIPS_PWCTL_HUGEPG_SHIFT,
 +              (pwctl & MIPS_PWCTL_PSN_MASK) >> MIPS_PWCTL_PSN_SHIFT);
 +}
 +
 +static void config_htw_params(void)
 +{
 +      unsigned long pwfield, pwsize, ptei;
 +      unsigned int config;
 +
 +      /*
 +       * We are using 2-level page tables, so we only need to
 +       * setup GDW and PTW appropriately. UDW and MDW will remain 0.
 +       * The default value of GDI/UDI/MDI/PTI is 0xc. It is illegal to
 +       * write values less than 0xc in these fields because the entire
 +       * write will be dropped. As a result of which, we must preserve
 +       * the original reset values and overwrite only what we really want.
 +       */
 +
 +      pwfield = read_c0_pwfield();
 +      /* re-initialize the GDI field */
 +      pwfield &= ~MIPS_PWFIELD_GDI_MASK;
 +      pwfield |= PGDIR_SHIFT << MIPS_PWFIELD_GDI_SHIFT;
 +      /* re-initialize the PTI field including the even/odd bit */
 +      pwfield &= ~MIPS_PWFIELD_PTI_MASK;
 +      pwfield |= PAGE_SHIFT << MIPS_PWFIELD_PTI_SHIFT;
 +      /* Set the PTEI right shift */
 +      ptei = _PAGE_GLOBAL_SHIFT << MIPS_PWFIELD_PTEI_SHIFT;
 +      pwfield |= ptei;
 +      write_c0_pwfield(pwfield);
 +      /* Check whether the PTEI value is supported */
 +      back_to_back_c0_hazard();
 +      pwfield = read_c0_pwfield();
 +      if (((pwfield & MIPS_PWFIELD_PTEI_MASK) << MIPS_PWFIELD_PTEI_SHIFT)
 +              != ptei) {
 +              pr_warn("Unsupported PTEI field value: 0x%lx. HTW will not be enabled",
 +                      ptei);
 +              /*
 +               * Drop option to avoid HTW being enabled via another path
 +               * (eg htw_reset())
 +               */
 +              current_cpu_data.options &= ~MIPS_CPU_HTW;
 +              return;
 +      }
 +
 +      pwsize = ilog2(PTRS_PER_PGD) << MIPS_PWSIZE_GDW_SHIFT;
 +      pwsize |= ilog2(PTRS_PER_PTE) << MIPS_PWSIZE_PTW_SHIFT;
 +      write_c0_pwsize(pwsize);
 +
 +      /* Make sure everything is set before we enable the HTW */
 +      back_to_back_c0_hazard();
 +
 +      /* Enable HTW and disable the rest of the pwctl fields */
 +      config = 1 << MIPS_PWCTL_PWEN_SHIFT;
 +      write_c0_pwctl(config);
 +      pr_info("Hardware Page Table Walker enabled\n");
 +
 +      print_htw_config();
 +}
 +
  void build_tlb_refill_handler(void)
  {
        /*
                }
                if (cpu_has_local_ebase)
                        build_r4000_tlb_refill_handler();
 +              if (cpu_has_htw)
 +                      config_htw_params();
 +
        }
  }
index 03a4cdc80226596053c6371978ef07ccce289301,ba612687b8f188ce8906c001833c7ba12826f8e4..e31e8cdcb296bfadc9c6ab2f394e089b4f48ad4b
@@@ -223,6 -223,7 +223,7 @@@ static struct platform_device rb532_wd
  
  static struct plat_serial8250_port rb532_uart_res[] = {
        {
+               .type           = PORT_16550A,
                .membase        = (char *)KSEG1ADDR(REGBASE + UART0BASE),
                .irq            = UART0_IRQ,
                .regshift       = 2,
@@@ -250,6 -251,28 +251,6 @@@ static struct platform_device *rb532_de
        &rb532_wdt
  };
  
 -static void __init parse_mac_addr(char *macstr)
 -{
 -      int i, h, l;
 -
 -      for (i = 0; i < 6; i++) {
 -              if (i != 5 && *(macstr + 2) != ':')
 -                      return;
 -
 -              h = hex_to_bin(*macstr++);
 -              if (h == -1)
 -                      return;
 -
 -              l = hex_to_bin(*macstr++);
 -              if (l == -1)
 -                      return;
 -
 -              macstr++;
 -              korina_dev0_data.mac[i] = (h << 4) + l;
 -      }
 -}
 -
 -
  /* NAND definitions */
  #define NAND_CHIP_DELAY 25
  
@@@ -311,10 -334,7 +312,10 @@@ static int __init plat_setup_devices(vo
  static int __init setup_kmac(char *s)
  {
        printk(KERN_INFO "korina mac = %s\n", s);
 -      parse_mac_addr(s);
 +      if (!mac_pton(s, korina_dev0_data.mac)) {
 +              printk(KERN_ERR "Invalid mac\n");
 +              return -EINVAL;
 +      }
        return 0;
  }
  
This page took 0.050947 seconds and 5 git commands to generate.