diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/arch-s3c2410/regs-clock.h | 21 | ||||
| -rw-r--r-- | include/linux/hugetlb.h | 16 |
2 files changed, 20 insertions, 17 deletions
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h index 16f4c3cc1388..34360706e016 100644 --- a/include/asm-arm/arch-s3c2410/regs-clock.h +++ b/include/asm-arm/arch-s3c2410/regs-clock.h | |||
| @@ -18,7 +18,9 @@ | |||
| 18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) | 18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) |
| 19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA | 19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA |
| 20 | * 27-Aug-2005 Ben Dooks Add clock-slow info | 20 | * 27-Aug-2005 Ben Dooks Add clock-slow info |
| 21 | */ | 21 | * 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat) |
| 22 | * 20-Oct-2005 Ben Dooks Add masks for DCLK (Guillaume Gourat) | ||
| 23 | */ | ||
| 22 | 24 | ||
| 23 | #ifndef __ASM_ARM_REGS_CLOCK | 25 | #ifndef __ASM_ARM_REGS_CLOCK |
| 24 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" | 26 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" |
| @@ -66,11 +68,16 @@ | |||
| 66 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) | 68 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) |
| 67 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) | 69 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) |
| 68 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) | 70 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) |
| 71 | #define S3C2410_DCLKCON_DCLK0_DIV_MASK ((0xf)<<4) | ||
| 72 | #define S3C2410_DCLKCON_DCLK0_CMP_MASK ((0xf)<<8) | ||
| 69 | 73 | ||
| 70 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) | 74 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) |
| 71 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) | 75 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) |
| 72 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) | 76 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) |
| 73 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) | 77 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) |
| 78 | #define S3C2410_DCLKCON_DCLK1_CMP(x) (((x) - 1) <<24) | ||
| 79 | #define S3C2410_DCLKCON_DCLK1_DIV_MASK ((0xf) <<20) | ||
| 80 | #define S3C2410_DCLKCON_DCLK1_CMP_MASK ((0xf) <<24) | ||
| 74 | 81 | ||
| 75 | #define S3C2410_CLKDIVN_PDIVN (1<<0) | 82 | #define S3C2410_CLKDIVN_PDIVN (1<<0) |
| 76 | #define S3C2410_CLKDIVN_HDIVN (1<<1) | 83 | #define S3C2410_CLKDIVN_HDIVN (1<<1) |
| @@ -83,10 +90,13 @@ | |||
| 83 | 90 | ||
| 84 | #ifndef __ASSEMBLY__ | 91 | #ifndef __ASSEMBLY__ |
| 85 | 92 | ||
| 93 | #include <asm/div64.h> | ||
| 94 | |||
| 86 | static inline unsigned int | 95 | static inline unsigned int |
| 87 | s3c2410_get_pll(int pllval, int baseclk) | 96 | s3c2410_get_pll(unsigned int pllval, unsigned int baseclk) |
| 88 | { | 97 | { |
| 89 | int mdiv, pdiv, sdiv; | 98 | unsigned int mdiv, pdiv, sdiv; |
| 99 | uint64_t fvco; | ||
| 90 | 100 | ||
| 91 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; | 101 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; |
| 92 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; | 102 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; |
| @@ -96,7 +106,10 @@ s3c2410_get_pll(int pllval, int baseclk) | |||
| 96 | pdiv &= S3C2410_PLLCON_PDIVMASK; | 106 | pdiv &= S3C2410_PLLCON_PDIVMASK; |
| 97 | sdiv &= S3C2410_PLLCON_SDIVMASK; | 107 | sdiv &= S3C2410_PLLCON_SDIVMASK; |
| 98 | 108 | ||
| 99 | return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv); | 109 | fvco = (uint64_t)baseclk * (mdiv + 8); |
| 110 | do_div(fvco, (pdiv + 2) << sdiv); | ||
| 111 | |||
| 112 | return (unsigned int)fvco; | ||
| 100 | } | 113 | } |
| 101 | 114 | ||
| 102 | #endif /* __ASSEMBLY__ */ | 115 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 42cb7d70f9ac..d664330d900e 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -25,6 +25,8 @@ int is_hugepage_mem_enough(size_t); | |||
| 25 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
| 26 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
| 27 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
| 28 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | ||
| 29 | unsigned long address, int write_access); | ||
| 28 | 30 | ||
| 29 | extern unsigned long max_huge_pages; | 31 | extern unsigned long max_huge_pages; |
| 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 32 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
| @@ -99,6 +101,7 @@ static inline unsigned long hugetlb_total_pages(void) | |||
| 99 | do { } while (0) | 101 | do { } while (0) |
| 100 | #define alloc_huge_page() ({ NULL; }) | 102 | #define alloc_huge_page() ({ NULL; }) |
| 101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | 103 | #define free_huge_page(p) ({ (void)(p); BUG(); }) |
| 104 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | ||
| 102 | 105 | ||
| 103 | #ifndef HPAGE_MASK | 106 | #ifndef HPAGE_MASK |
| 104 | #define HPAGE_MASK 0 /* Keep the compiler happy */ | 107 | #define HPAGE_MASK 0 /* Keep the compiler happy */ |
| @@ -155,24 +158,11 @@ static inline void set_file_hugepages(struct file *file) | |||
| 155 | { | 158 | { |
| 156 | file->f_op = &hugetlbfs_file_operations; | 159 | file->f_op = &hugetlbfs_file_operations; |
| 157 | } | 160 | } |
| 158 | |||
| 159 | static inline int valid_hugetlb_file_off(struct vm_area_struct *vma, | ||
| 160 | unsigned long address) | ||
| 161 | { | ||
| 162 | struct inode *inode = vma->vm_file->f_dentry->d_inode; | ||
| 163 | loff_t file_off = address - vma->vm_start; | ||
| 164 | |||
| 165 | file_off += (vma->vm_pgoff << PAGE_SHIFT); | ||
| 166 | |||
| 167 | return (file_off < inode->i_size); | ||
| 168 | } | ||
| 169 | |||
| 170 | #else /* !CONFIG_HUGETLBFS */ | 161 | #else /* !CONFIG_HUGETLBFS */ |
| 171 | 162 | ||
| 172 | #define is_file_hugepages(file) 0 | 163 | #define is_file_hugepages(file) 0 |
| 173 | #define set_file_hugepages(file) BUG() | 164 | #define set_file_hugepages(file) BUG() |
| 174 | #define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) | 165 | #define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) |
| 175 | #define valid_hugetlb_file_off(vma, address) 0 | ||
| 176 | 166 | ||
| 177 | #endif /* !CONFIG_HUGETLBFS */ | 167 | #endif /* !CONFIG_HUGETLBFS */ |
| 178 | 168 | ||
